--- id: pytest-textual-snapshot version: "1.1.0" license: MIT license_treatment: permissive maintenance: dormant --- # pytest-textual-snapshot — Snapshot testing for Textual apps License: permissive · Maintenance: dormant · Downloads: 343.8K/mo ## What it is and what it does pytest-textual-snapshot is a pytest plugin that automates visual regression testing for Textual terminal user interface applications. It works by capturing SVG screenshots of your Textual app during test execution, storing them on disk, and comparing new screenshots against saved baselines on subsequent runs. When a screenshot differs from the baseline, the test fails and provides a diff report. The plugin integrates directly into pytest via the snap_compare fixture, which accepts either a Textual App instance or a path to an app file. It supports simulating key presses, running setup code before capture, and customizing terminal dimensions to test different layouts. When snapshots change intentionally, you update them with the --snapshot-update flag. The package depends on pytest, rich, textual, syrupy, and jinja2. Use it for: - Detect unintended visual changes in Textual UI layouts, colors, or text rendering across code commits. - Test responsive behavior of terminal apps by capturing snapshots at different terminal sizes. - Verify that keyboard interactions produce the expected visual state after key presses. - Automate regression detection for complex Textual dashboards or data-display applications. - Document expected visual output of a Textual app by storing and reviewing baseline snapshots. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. A pytest plugin that captures SVG screenshots of Textual terminal applications and compares them across test runs to detect visual regressions automatically. Yes, if you are actively developing Textual applications and want automated visual regression testing. The low install friction, permissive MIT license, and Production/Stable status make it straightforward to add to a pytest workflow. However, the dormant maintenance status (568 days since last release) means you should verify compatibility with your current Textual version before committing to it in a production pipeline. ## Install pip install pytest-textual-snapshot uv add pytest-textual-snapshot poetry add pytest-textual-snapshot ## Installing pytest-textual-snapshot Before you install: Low friction installation as a pure Python wheel. Dormant maintenance status (568 days since last release) means no active development, though marked Production/Stable. License in practice: MIT license is permissive, allowing use in commercial and open-source projects with minimal restrictions—just retain the license notice. Quickstart: pip install pytest-textual-snapshot # In your test file: def test_my_app(snap_compare): app = MyTextualApp() assert snap_compare(app) # Or with key presses: def test_with_interaction(snap_compare): assert snap_compare("path/to/app.py", press=["tab", "left"]) Requires textual and pytest to be installed; your Textual app must be a non-running App instance or a path to a file containing an App subclass. Verify before relying: - Whether the package works reliably with the latest versions of textual, given the dormant maintenance status. - Performance characteristics when running large numbers of snapshot tests in parallel with pytest-xdist. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: dormant - Downloads: 343.8K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags textual app snapshot testing, pytest visual regression testing, terminal ui screenshot comparison, textual tui testing, snapshot testing terminal apps, textual-testing, visual-regression, snapshot-testing [View on SkillFed](https://skillfed.io/packages/pytest-textual-snapshot) · [View on PyPI](https://pypi.org/project/pytest-textual-snapshot/)