CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-syrupy

Pytest snapshot testing utility that enables developers to write tests asserting immutability of computed results.

Overall
score

80%

Overview
Eval results
Files

task.mdevals/scenario-10/

Snapshot Format Sampler

Create small helpers that emit deterministic artifacts in multiple formats (structured data, JSON payloads, raw bytes, PNG bytes, and SVG markup) and verify them with snapshot tests stored through the snapshot tool's built-in extensions.

Capabilities

Amber snapshot for structured data

  • Snapshotting the order summary output saves a multi-snapshot amber file containing order id, customer tier, two line items, subtotal, tax, grand total, and tags, and reruns match the saved snapshot. @test

JSON snapshot for API payloads

  • Snapshotting the inventory payload writes a .json snapshot with stable key ordering that includes two SKU entries with name, stock count, and category fields. @test

Raw snapshot for binary payloads

  • Snapshotting the raw telemetry bytes stores a single-file raw snapshot whose content starts with an ASCII header, includes a version byte, body bytes, and checksum, and matches exactly on reruns. @test

Image snapshots for PNG and SVG

  • Snapshotting the generated PNG badge bytes writes a .png snapshot representing a tiny badge that uses at least two distinct colors and remains byte-identical on reruns. @test
  • Snapshotting the SVG badge markup writes a .svg snapshot containing width/height attributes, a shape element, and text label content that remains identical on reruns. @test

Implementation

@generates

API

def build_order_summary() -> dict:
    """Return structured purchase summary data with two line items, totals, taxes, and tag metadata."""

def build_inventory_payload() -> dict:
    """Return JSON-serializable inventory payload for at least two SKUs, including stock counts and categories."""

def build_raw_telemetry() -> bytes:
    """Return deterministic raw bytes payload containing an ASCII header, version byte, body bytes, and checksum."""

def generate_png_badge() -> bytes:
    """Return PNG-encoded bytes for a tiny badge image that contains at least two distinct colors."""

def generate_svg_badge() -> str:
    """Return SVG markup for a small badge that includes dimensions, a shape, and visible text."""

Dependencies { .dependencies }

syrupy { .dependency }

Snapshot testing plugin that provides built-in amber, json, raw, png, and svg snapshot extensions.

Install with Tessl CLI

npx tessl i tessl/pypi-syrupy

tile.json