Pytest snapshot testing utility that enables developers to write tests asserting immutability of computed results.
Overall
score
80%
Configure snapshot testing defaults so snapshot files share the same serialization, storage location, and output style across a test session.
snapshots_alt, newly written snapshots for a sample payload are placed under that directory with a .json extension. @test@generates
from typing import Any, Callable
ConfiguredSnapshot = Any
def make_persisted_snapshot(
base_snapshot: Any,
*,
matcher: Callable[..., Any],
exclude_fields: tuple[str, ...],
) -> ConfiguredSnapshot:
"""
Return a snapshot assertion variant that keeps the matcher and exclusions
as defaults across multiple uses within a test.
"""
def capture_payloads(snapshot: ConfiguredSnapshot, *payloads: Any) -> list[Any]:
"""
Assert each payload against the configured snapshot variant in order and
return the payloads after assertion.
"""Python snapshot testing library for pytest; provides the snapshot assertion fixture, global defaults configuration, and CLI options for extension, directory naming, and color handling.
Install with Tessl CLI
npx tessl i tessl/pypi-syrupyevals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10