{"categories":[{"label":"Testing","url":"https://skillfed.io/packages/category/software-development-testing/2"}],"enrichment":{"capability":"A pytest plugin that enables snapshot testing\u2014comparing test outputs against saved reference files to detect unexpected changes without manual assertion updates.","skillfed_tags":["testing","regression-testing"],"use_cases":["Testing formatted output (JSON, YAML, HTML) where manual assertion maintenance is tedious.","Regression testing large or complex data structures by comparing against golden files.","Parametrized tests over many input cases, where each case's expected output is stored in a separate snapshot file.","Verifying that refactoring or API changes produce expected output changes, with easy bulk review via --snapshot-update.","Organizing test fixtures as readable snapshot files in version control rather than embedded test constants."],"what_it_does":"pytest-snapshot is a pytest plugin that implements snapshot testing\u2014a pattern where test assertions compare actual output against saved reference files (snapshots) rather than hardcoded expected values. When a function's output changes, you run pytest with --snapshot-update to regenerate snapshots, review the changes, and commit them to version control. This reduces boilerplate in tests and makes it easy to spot when behavior changes unexpectedly.\n\nThe plugin works with strings and bytes directly, and supports both single-file snapshots (via assert_match) and directory-based snapshot collections (via assert_match_dir). It gives you full control over snapshot file paths and serialization\u2014you decide how to format output (JSON, YAML, plain text) before passing it to the snapshot method. The design is inspired by Jest's snapshot testing and emphasizes human-readable snapshots that are easy to review in code diffs and pull requests.","worth_installing":"Yes, if you use pytest and want to reduce assertion boilerplate in tests with large or frequently-changing outputs. The low install friction and permissive license make adoption straightforward. However, maintenance is dormant; verify compatibility with your pytest and Python versions before relying on it for new projects, and monitor the repository for any compatibility issues."},"id":"pytest-snapshot","links":{"html":"https://skillfed.io/packages/pytest-snapshot","md":"https://skillfed.io/packages/pytest-snapshot.md","pypi":"https://pypi.org/project/pytest-snapshot/"},"maintenance":{"status":"dormant"},"meta":{"latest_release":"2022-04-23","license_spdx":null,"license_treatment":"permissive","name":"pytest-snapshot","python_support":"supports_current","summary":"A plugin for snapshot testing with pytest."},"popularity":{"monthly_downloads":2603450,"position":2971,"tier":"top_5000"},"security":{"n_vulnerabilities":0},"version":"0.9.0"}
