snapshottest
Snapshot testing for pytest, unittest, Django, and Nose
Decision gist · record as of 2026-08-14
Yes, with caution on maintenance. Snapshot testing is a proven pattern and this package is stable and widely used. However, it has been dormant since 2020-09-29 with no recent commits—if you need active maintenance, bug fixes, or support for cutting-edge test frameworks, consider whether a more actively maintained alternative fits your timeline. For established projects with stable test suites, it remains a solid choice.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Low friction install with three lightweight runtime dependencies (six, termcolor, fastdiff).
- Maintenance is dormant—last release was 2020-09-29 and no commits since 2024-08-01—so expect no active bug fixes or feature development, though the package is marked Production/Stable.
License · maintenance · safety
MIT (permissive) — MIT license is permissive; you can use, modify, and distribute this package freely in commercial and open-source projects with minimal restrictions.
last release 2020-09-29 (2145 days) · last repo commit 2024-08-01 · 549 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 488,476 downloads/mo, #6,380 on PyPI
Alternatives
Verify before relying
pip install snapshottest
# With pytest:
from snapshottest import snapshot
def test_api(snapshot):
response = api.client.get('/me')
snapshot.assert_match(response)
# With unittest:
from snapshottest import TestCase
class APITest(TestCase):
def test_api(self):
response = api.client.get('/me')
self.assertMatchSnapshot(response)- Whether the package works reliably with modern Python versions beyond 3.8, given the last release was 2020-09-29
- Current compatibility status with recent versions of pytest, unittest, and Django test runners
- Whether dormant status means critical bugs or security issues would go unpatched
What it is and what it does
Snapshot testing lets you capture the state of an API response or other serializable output once, store it as a reference file, and then automatically compare future test runs against that snapshot. Instead of writing explicit assertions for every field in a response, you assert that the output matches the saved snapshot; if it changes, the test fails and you can review the diff to decide whether the change is expected (and update the snapshot) or a regression.
The package integrates with pytest, unittest, Django, and nose, so it fits into existing test suites. It depends on six, termcolor, and fastdiff to handle cross-version compatibility, colored diff output, and efficient comparison. The workflow is: write a test that calls your API, call snapshot.assert_match() or self.assertMatchSnapshot(), and on first run it saves the response; on subsequent runs it compares. You can update snapshots in bulk with a command-line flag when changes are intentional.
Use it for
- Testing REST API endpoints by capturing and comparing full JSON responses without hand-writing field assertions
- Regression testing UI component serialization or GraphQL query results across code changes
- Validating complex nested data structures where manual assertion would be tedious and brittle
- Bulk-updating test expectations after intentional API schema changes using --snapshot-update
- Documenting expected API behavior by reviewing snapshot diffs in version control
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, with caution on maintenance.
Snapshot testing is a proven pattern and this package is stable and widely used. However, it has been dormant since 2020-09-29 with no recent commits—if you need active maintenance, bug fixes, or support for cutting-edge test frameworks, consider whether a more actively maintained alternative fits your timeline. For established projects with stable test suites, it remains a solid choice.
Install
snapshottest on PyPI
Before you install
Low friction install with three lightweight runtime dependencies (six, termcolor, fastdiff). Maintenance is dormant—last release was 2020-09-29 and no commits since 2024-08-01—so expect no active bug fixes or feature development, though the package is marked Production/Stable.
License in practice
MIT license is permissive; you can use, modify, and distribute this package freely in commercial and open-source projects with minimal restrictions.
Quickstart
pip install snapshottest
# With pytest:
from snapshottest import snapshot
def test_api(snapshot):
response = api.client.get('/me')
snapshot.assert_match(response)
# With unittest:
from snapshottest import TestCase
class APITest(TestCase):
def test_api(self):
response = api.client.get('/me')
self.assertMatchSnapshot(response)
Verify before relying
- Whether the package works reliably with modern Python versions beyond 3.8, given the last release was 2020-09-29
- Current compatibility status with recent versions of pytest, unittest, and Django test runners
- Whether dormant status means critical bugs or security issues would go unpatched
Package facts
| License | MIT permissive |
| Python support | Not specified |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 3 packagessixtermcolorfastdiff |
| Maintenance | Dormant 2,145 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 488,476 / month, #6,380 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableFramework :: PytestIntended Audience :: DevelopersOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Topic :: Software Development :: Libraries |
Evidence: snapshottest-0.6.0-py2.py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “unittest snapshot assertions”
- snapshottestSnapshot testing library that captures API responses or other…
- expecttestexpecttest implements inline golden tests where expected outputs are…
- syrupySyrupy is a pytest plugin that enables snapshot testing by letting…
Give your agent the search over MCP, or paste the wish link into any chat.
More Libraries packages
urllib3 is an HTTP client library that provides thread-safe connection pooling, SSL/TLS verification, multipart file uploads, request retries, compression support, and proxy handling for Python applications.
Requests is a Python HTTP library that simplifies sending HTTP/1.1 requests with automatic handling of headers, authentication, cookies, and response parsing.
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
Provides parsing, arithmetic, and recurrence rule computation for dates and times, with timezone support and iCalendar RFC compliance.
Install it if you need to parse flexible date strings, compute relative dates, handle timezones, or work with recurrence rules—it's the de facto choice for these tasks.
Six provides utility functions to write Python code that runs on both Python 2.7 and Python 3.3+, smoothing over language differences between the two versions.
pytest is a testing framework that lets you write test functions using plain assert statements and automatically discovers and runs them, with detailed failure reporting.
See also pytest-snapshot · snapshot-restore-py · pytest-insta · syrupy · inline-snapshot · expecttest · pytest-textual-snapshot · pynose · pytest-playwright-visual · core-universal