{"id":27299,"library":"pytest-insta","title":"pytest-insta","description":"A practical snapshot testing plugin for pytest, providing a simple way to compare test results against stored snapshots. Current version is 0.4.1, with a release cadence of approximately monthly.","status":"active","version":"0.4.1","language":"python","source_language":"en","source_url":"https://github.com/pytest-dev/pytest-insta","tags":["pytest","snapshot-testing","testing","plugin"],"install":[{"cmd":"pip install pytest-insta","lang":"bash","label":"install"}],"dependencies":[{"reason":"Required for pytest plugin functionality","package":"pytest","optional":false}],"imports":[{"note":"No wrong import common; use as plugin marker","wrong":"","symbol":"pytest_insta","correct":"import pytest_insta"},{"note":"Fixture usage: def test_foo(snapshot): assert snapshot() == value","wrong":"","symbol":"snapshot fixture","correct":"from pytest_insta import snapshot"}],"quickstart":{"code":"# content of test_example.py\nimport pytest\nimport requests\n\ndef test_with_snapshot(snapshot):\n    response = requests.get('https://api.github.com')\n    assert snapshot() == response.json()\n","lang":"python","description":"Basic snapshot test using the snapshot fixture. Run with 'pytest --insta' to record snapshots."},"warnings":[{"fix":"Re-run tests with --insta-update to regenerate snapshots in new format.","message":"Version 0.4.0 changed the default snapshot storage format from .snap to .json. Existing .snap files will not be recognized unless migrated.","severity":"breaking","affected_versions":"<0.4.0"},{"fix":"Use the built-in fixture 'snapshot_name' to specify custom snapshot names.","message":"The 'snapshot' fixture argument 'name' is deprecated in 0.4.0; use 'snapshot_name' fixture instead.","severity":"deprecated","affected_versions":">=0.4.0"},{"fix":"Sort data or use custom serializers. Consider using pytest.approx for floats.","message":"Snapshot tests are not deterministic for unordered data (e.g., dicts with floating point). Snapshots are compared as JSON strings.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'0.4.1':25 'approxim':31 'cadenc':29 'compar':16 'current':22 'insta':3 'month':32 'plugin':8,38 'practic':5 'provid':11 'pytest':2,10,33 'pytest-insta':1 'releas':28 'result':18 'simpl':13 'snapshot':6,21,35 'snapshot-test':34 'store':20 'test':7,17,36,37 'version':23 'way':14","created_at":"2026-05-01T17:45:32.205484+00:00","updated_at":"2026-05-01T17:45:32.205484+00:00","problems":[{"fix":"Do not import; use the fixture in test function argument: def test_foo(snapshot):","cause":"Trying to import snapshot as a function instead of using the fixture.","error":"AttributeError: module 'pytest_insta' has no attribute 'snapshot'"},{"fix":"Install with pip install pytest-insta and ensure no conftest disables the plugin.","cause":"pytest-insta not installed or not enabled.","error":"pytest: error: unrecognized arguments: --insta"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":null,"docs":null,"changelog":null,"pypi":"https://pypi.org/project/pytest-insta/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-28","last_verified":"2026-06-28","next_check":"2026-07-29","install_tag":null}}