{"id":28109,"library":"pytest-expect-test","title":"pytest-expect-test","description":"A lightweight pytest plugin providing an `expect` fixture for snapshot testing. Version 0.1.0 is the initial release, requiring Python >=3.5. Development appears low-frequency, with no recent updates.","status":"active","version":"0.1.0","language":"python","source_language":"en","source_url":"https://github.com/daninge98/pytest-expect-test","tags":["pytest","expect-test","snapshot-testing","testing"],"install":[{"cmd":"pip install pytest-expect-test","lang":"bash","label":"PyPI"}],"dependencies":[],"imports":[{"note":"Direct import of the module gives pytest plugin; the fixture needs explicit import.","wrong":"import pytest_expect_test","symbol":"expect","correct":"from pytest_expect_test import expect"}],"quickstart":{"code":"def test_example(expect):\n    expect(2 + 2) == 4\n    # The first run records the expectation, subsequent runs compare.","lang":"python","description":"Basic usage: use the `expect` fixture to assert equality. On first run, the expected value is recorded; later runs check against the recorded snapshot."},"warnings":[{"fix":"Review the recorded expectations (typically stored in test directory) and commit them to version control.","message":"On first test run, the test passes regardless of the actual value because the expectation is recorded. Subsequent runs will fail if the actual value differs from recorded.","severity":"gotcha","affected_versions":"0.1.0"},{"fix":"Define test with `def test_foo(expect):` to inject the fixture.","message":"The `expect` fixture must be used as a parameter in the test function; it is not a regular assertion. Do not call `expect()` as a function without the fixture injection.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'0.1.0':17 '3.5':24 'appear':26 'develop':25 'expect':3,11,36 'expect-test':35 'fixtur':12 'frequenc':29 'initi':20 'lightweight':6 'low':28 'low-frequ':27 'plugin':8 'provid':9 'pytest':2,7,34 'pytest-expect-test':1 'python':23 'recent':32 'releas':21 'requir':22 'snapshot':14,39 'snapshot-test':38 'test':4,15,37,40,41 'updat':33 'version':16","created_at":"2026-05-09T05:53:46.531998+00:00","updated_at":"2026-05-09T05:53:46.531998+00:00","problems":[{"fix":"Run `pip install pytest-expect-test` and use `from pytest_expect_test import expect`.","cause":"Attempting to import `expect` directly from `pytest` or without installing the plugin.","error":"ImportError: cannot import name 'expect'"},{"fix":"Use `expect` as a function parameter in the test method: `def test_example(self, expect): expect(...)`","cause":"Using `self.expect` inside a test method in a class while `expect` is passed as a parameter. Not supported as class attribute.","error":"AttributeError: 'Test' object has no attribute 'expect'"}],"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":"https://github.com/daninge98/pytest-expect-test","docs":null,"changelog":null,"pypi":"https://pypi.org/project/pytest-expect-test/","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-29","last_verified":"2026-06-29","next_check":"2026-07-29","install_tag":null}}