expecttest
Decision gist · record as of 2026-08-14
Yes, if you prefer inline snapshots over external snapshot files and your team is comfortable with test files being modified during test runs. The library is stable, permissively licensed, and has no dependencies. The aging maintenance status is not a blocker for a mature, focused tool, but verify it still works smoothly with your pytest or unittest version before adopting it in a new project.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Low friction install with no runtime dependencies.
- Maintenance is aging—last release was 611 days ago—but the repository is active and not archived, with 88 stars.
License · maintenance · safety
MIT (permissive) — MIT license permits unrestricted use, modification, and distribution with only attribution required.
last release 2024-12-11 (611 days) · last repo commit 2025-06-06 · 88 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 2,333,091 downloads/mo, #3,130 on PyPI
Alternatives
Verify before relying
from expecttest import TestCase
class MyTest(TestCase):
def test_example(self):
self.assertExpectedInline(some_func(), """""")
# Run: EXPECTTEST_ACCEPT=1 python -m unittest- Whether the package works with pytest parameterization and fixtures beyond the documented Expect() pattern.
- Performance characteristics when updating large numbers of inline expectations in a single test run.
What it is and what it does
expecttest is a testing library that implements golden tests with inline expectations—a pattern where you write tests with blank expected-output placeholders, run them to capture actual output, then rerun with EXPECTTEST_ACCEPT=1 to automatically populate the source code with the captured values. It works with both unittest and pytest, and supports multiline strings via triple-quoted literals.
The library modifies your Python test files directly when accepting new expectations, rather than storing them in external snapshot files. This keeps test logic and expectations in one place but requires careful version control practices. It's useful when you want to verify complex output (formatted strings, error messages, data structures) without manually writing expected values.
Use it for
- Verify formatted output of code generators or transpilers by capturing and versioning the generated code inline.
- Test error messages and exception formatting by accepting the actual output as the expected baseline.
- Snapshot test complex data structure representations without maintaining separate snapshot files.
- Validate multi-line string output in documentation examples or report generation.
- Update test expectations in bulk when intentional API changes produce different but correct output.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you prefer inline snapshots over external snapshot files and your team is comfortable with test files being modified during test runs.
The library is stable, permissively licensed, and has no dependencies. The aging maintenance status is not a blocker for a mature, focused tool, but verify it still works smoothly with your pytest or unittest version before adopting it in a new project.
Install
expecttest on PyPI
Before you install
Low friction install with no runtime dependencies. Maintenance is aging—last release was 611 days ago—but the repository is active and not archived, with 88 stars.
License in practice
MIT license permits unrestricted use, modification, and distribution with only attribution required.
Quickstart
from expecttest import TestCase
class MyTest(TestCase):
def test_example(self):
self.assertExpectedInline(some_func(), """""")
# Run: EXPECTTEST_ACCEPT=1 python -m unittest
Verify before relying
- Whether the package works with pytest parameterization and fixtures beyond the documented Expect() pattern.
- Performance characteristics when updating large numbers of inline expectations in a single test run.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release <4.0.0,>=3.8.1 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Aging 611 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 2,333,091 / month, #3,130 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | License :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.9 |
Evidence: expecttest-0.3.0-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 › “golden tests python”
- expecttestexpecttest implements inline golden tests where expected outputs are…
- pytest-snapshotA pytest plugin that enables snapshot testing—comparing test outputs…
- pytest-regressionsProvides pytest fixtures for writing regression tests that compare…
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 approvaltests · approval-utilities · snapshottest · sure · pytest-snapshot · asserts · expects · lambdatest-selenium-driver · html-testRunner · inline-snapshot