skillfed

pytest-insta

A practical snapshot testing plugin for pytest

pytest-insta v0.4.1 252.4K downloads/30d#8,545 on PyPI
License unclear AGING released

What it is and what it does

pytest-insta is a snapshot testing plugin for pytest that lets you write assertions by comparing outputs to stored reference values. Instead of hardcoding expected results, you call `snapshot()` in your test and the plugin records the actual output; on subsequent runs, it compares the new output to the stored snapshot and flags differences. The plugin handles multiple snapshot formats out of the box—text, binary, hexdump, JSON, and pickle—and lets you define custom formats by subclassing the `Fmt` class.

The workflow is designed around an interactive review tool. When snapshots differ, you can use `pytest --insta review` to inspect each change in a Python REPL, then accept or reject it. This makes it easy to catch unintended regressions while deliberately approving intentional changes. The plugin also supports batch operations like `--insta update` to accept all changes at once, or `--insta record` to defer review until later. It depends only on pytest and wrapt, keeping the install lightweight.

Use it for:

  • Verify that refactored code produces identical output to the original without manually comparing large strings or objects.
  • Track changes to JSON or structured data across test runs and approve them interactively rather than rewriting assertions.
  • Test code that generates formatted text (logs, reports, code) by storing the output as a snapshot and catching unintended formatting changes.
  • Build regression tests for complex data transformations by storing the result once and comparing future runs against it.
  • Maintain test assertions for serialized objects (pickle, binary) that would be tedious to hardcode in the test file.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

A pytest plugin that enables snapshot testing by comparing test outputs against stored reference values, with built-in support for text, binary, JSON, and pickle formats plus an interactive review tool.

Yes, with conditions. The plugin is well-designed for snapshot testing workflows and has low install friction. However, the unclear license and aging maintenance (265 days since last release) mean you should verify the license terms and assess whether the project's pace matches your support expectations before adopting it in production. No known vulnerabilities.

Install

pytest-insta on PyPI

pip

pip install pytest-insta

uv

uv add pytest-insta

poetry

poetry add pytest-insta

Installing pytest-insta

Before you install

Low install friction with only two runtime dependencies (pytest and wrapt). Maintenance status is aging—last release was 265 days ago—so expect slower response to issues, though no active vulnerabilities are known.

License in practice

License treatment is unclear; the package metadata does not declare an SPDX license identifier or raw license string, so you should verify the actual license terms in the repository before adopting it in a commercial or restricted context.

Quickstart

pip install pytest-insta

# In a test file:
def test_example(snapshot):
    assert snapshot() == "expected output"

# Run with pytest --insta update to record or approve snapshots

Requires Python >=3.10

Verify before relying

  • Actual license terms—metadata does not specify SPDX or raw license
  • Repository URL and current maintainer activity—metadata lacks project URLs
  • Whether aging maintenance status affects bug fixes or compatibility with newer pytest versions

Package facts

License not declared (unclear)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 2 — pytest, wrapt
Maintenance aging — 265 days since the last release
First released
Downloads 252,375/month — #8,545 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: pytest_insta-0.4.1-py3-none-any.whl

Keywords: pytest-plugin, pytest, testing, snapshot, snapshot-testing

Framework :: Pytest

Tags

snapshot testing pytestpytest snapshot plugintest output comparisonregression testing pythonpytest assertion snapshots
snapshot-testingpytest-pluginregression-testing

More Testing packages