inline-snapshot
golden master/snapshot/approval testing library which puts the values right into your source code
Decision gist · record as of 2026-08-14
Yes. inline-snapshot is actively maintained, has low install friction, zero known vulnerabilities, and solves a real problem for teams doing approval or golden-master testing. The inline-code-first approach is a genuine alternative to file-based snapshot tools. Install it if you want snapshot testing without managing separate snapshot files, or if you prefer reviewing and approving test changes as part of code review.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires pytest to be installed and tests to be run via pytest; review mode works best on CPython 3.11+ (older versions require --inline-snapshot=review flag).
- Low friction install with a pure-Python wheel.
- Active maintenance: released 3 days ago with 749 repository stars.
License · maintenance · safety
permissive license (permissive) — MIT license (permissive). Free to use, modify, and distribute in both open-source and commercial projects with minimal restrictions.
last release 2026-08-11 (3 days) · last repo commit 2026-08-14 · 749 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 2,126,963 downloads/mo, #3,271 on PyPI
Alternatives
Verify before relying
pip install inline-snapshot
from inline_snapshot import snapshot
def test_something():
assert 1548 * 18489 == snapshot(28620972)- Whether the package works reliably with PyPy in practice despite classifier support.
- Performance impact when working with very large snapshot datasets or many snapshots per test file.
What it is and what it does
inline-snapshot is a pytest plugin that embeds snapshot values directly in your test source code, turning snapshot testing into a code-first workflow. Instead of storing expected values in separate files, you write `snapshot()` placeholders in assertions, then run pytest with `--inline-snapshot=review` to see what values the test produces and approve them inline. The plugin rewrites your test file with the actual values, keeping your assertions and test logic in one place.
It supports multiple comparison modes (equality, ordering, membership, indexing), can store large snapshots externally, integrates with Black formatting, and works with normal assertions like `assert 1 + 1 == 3` as well as snapshot-specific syntax. Runtime dependencies are minimal: asttokens, executing, pytest, rich, tomli, and typing-extensions. The package is actively maintained, supports Python 3.9 through 3.14, and has no known security vulnerabilities.
Use it for
- Verify complex output (JSON, HTML, error messages) by embedding the expected result in your test and auto-updating it when the output legitimately changes.
- Test function arguments and return values by using snapshot_arg() to capture and compare function parameters across test runs.
- Maintain approval tests for command-line tools or subprocess output where you want to review and lock in expected behavior.
- Compare structured data (nested dicts, lists) with fuzzy matching support via dirty-equals for flexible assertions on dynamic parts.
- Store large or multiline snapshot data externally while keeping test logic readable and inline.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
inline-snapshot is actively maintained, has low install friction, zero known vulnerabilities, and solves a real problem for teams doing approval or golden-master testing. The inline-code-first approach is a genuine alternative to file-based snapshot tools. Install it if you want snapshot testing without managing separate snapshot files, or if you prefer reviewing and approving test changes as part of code review.
Install
inline-snapshot on PyPI
Before you install
Low friction install with a pure-Python wheel. Active maintenance: released 3 days ago with 749 repository stars. Depends on six runtime packages (asttokens, executing, pytest, rich, tomli, typing-extensions), all common testing and utility libraries.
Requires pytest to be installed and tests to be run via pytest; review mode works best on CPython 3.11+ (older versions require --inline-snapshot=review flag).
License in practice
MIT license (permissive). Free to use, modify, and distribute in both open-source and commercial projects with minimal restrictions.
Quickstart
pip install inline-snapshot
from inline_snapshot import snapshot
def test_something():
assert 1548 * 18489 == snapshot(28620972)
Verify before relying
- Whether the package works reliably with PyPy in practice despite classifier support.
- Performance impact when working with very large snapshot datasets or many snapshots per test file.
Package facts
| License | permissive license permissive |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 6 packagesasttokensexecutingpytestrichtomlityping-extensions |
| Maintenance | Actively maintained 3 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 2,126,963 / month, #3,271 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaFramework :: PytestIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Software Development :: Testing |
Evidence: inline_snapshot-0.35.4-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 › “approval testing inline”
- inline-snapshotinline-snapshot is a pytest plugin that lets you write snapshot tests…
- approval-utilitiesProvides utility functions and helpers for snapshot-based testing and…
- approvaltestsApprovalTests provides a snapshot-based assertion library for testing…
Give your agent the search over MCP, or paste the wish link into any chat.
More Testing packages
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.
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.
virtualenv creates isolated Python environments where packages can be installed independently without affecting the system Python or other projects.
Coverage.py measures which lines of Python code are executed during test runs, reporting coverage percentages and identifying untested code paths.
Install it if you want to measure test completeness or enforce coverage thresholds in your project.
pytest-asyncio is a pytest plugin that enables writing and running async test functions using the asyncio library, allowing developers to await code directly within test cases.
Install it if you write tests for any asyncio-based code.
A pytest plugin that generates test reports in Common Test Report Format (CTRF) as JSON, compatible with pytest-xdist and pytest-playwright for distributed and browser-based testing.
Install it if you need CTRF-formatted test output for CI/CD integration or cross-tool reporting.
See also pytest-insta · pytest-snapshot · pytest-textual-snapshot · snapshottest · syrupy · pytest-playwright-visual · expecttest · pytest-regressions · approvaltests · assertpy