Skip to content

expect_string

Snapshot testing and expectations for strings.

StringExpect

StringExpect(
    settings: Settings, snappylapy_session: SnapshotSession
)

Bases: BaseSnapshot[str]

Snapshot testing for strings.

Initialize the base snapshot.

compare_snapshot_data

compare_snapshot_data(
    snapshot_data: bytes, test_data: bytes
) -> None

Compare snapshot data with test data.

Optimizations is needed for large data since difflib used in the pytest_assertion plugin rewrites are very slow when there are many diffs in large strings.

to_match_snapshot

to_match_snapshot() -> None

Assert test results match the snapshot.