{"id":22501,"library":"types-pytest-lazy-fixture","title":"types-pytest-lazy-fixture","description":"Typing stubs for pytest-lazy-fixture, providing type hints for LazyFixture and lazy_fixture. Current version 0.6.3.20260408, updated via typeshed. Low release cadence; updated with typeshed releases.","status":"active","version":"0.6.3.20260408","language":"python","source_language":"en","source_url":"https://github.com/python/typeshed","tags":["typing","stubs","pytest","lazy-fixture"],"install":[{"cmd":"pip install types-pytest-lazy-fixture","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"LazyFixture is not in the public pytest API; it is in _pytest.compat.","wrong":"from pytest import LazyFixture","symbol":"LazyFixture","correct":"from _pytest.compat import LazyFixture"},{"note":"The correct import is from the package 'pytest-lazy-fixture' (underscore version).","wrong":"from lazyfixture import lazy_fixture","symbol":"lazy_fixture","correct":"from pytest_lazyfixture import lazy_fixture"}],"quickstart":{"code":"from typing import Generator\nimport pytest\nfrom pytest_lazyfixture import lazy_fixture\n\ndef fixture_one() -> int:\n    return 1\n\ndef fixture_two(request) -> int:\n    return 2\n\n@pytest.mark.parametrize(\n    'arg',\n    [\n        lazy_fixture('fixture_one'),\n        lazy_fixture('fixture_two'),\n    ]\n)\ndef test_lazy(arg: int) -> None:\n    assert arg in (1, 2)\n","lang":"python","description":"Basic usage of lazy_fixture with parametrize. Note: types-pytest-lazy-fixture provides stubs for this pattern."},"warnings":[{"fix":"Use from _pytest.compat import LazyFixture if you need the type, but prefer using lazy_fixture from pytest_lazyfixture.","message":"Do not import LazyFixture from pytest; it is not part of the public API. It lives in _pytest.compat. The stubs in types-pytest-lazy-fixture rely on that internal path.","severity":"gotcha","affected_versions":"all"},{"fix":"Install via 'pip install pytest-lazy-fixture' (hyphens), then import as 'from pytest_lazyfixture import lazy_fixture' (underscores).","message":"The package name is 'pytest-lazy-fixture' (with hyphens), but the Python import uses underscores: pytest_lazyfixture. Using the wrong import leads to ModuleNotFoundError.","severity":"gotcha","affected_versions":"all"},{"fix":"Install both: pip install pytest-lazy-fixture types-pytest-lazy-fixture","message":"The original pytest-lazy-fixture project is unmaintained (last release 2020). types-pytest-lazy-fixture only provides type stubs, not the runtime package. Ensure you also install the runtime package.","severity":"deprecated","affected_versions":">=0.6.3"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Install the runtime package: pip install pytest-lazy-fixture","cause":"Missing runtime package; the stubs do not provide the actual module.","error":"ModuleNotFoundError: No module named 'pytest_lazyfixture'"},{"fix":"Use from _pytest.compat import LazyFixture or avoid importing it directly.","cause":"LazyFixture is not exposed from pytest; it's internal.","error":"ImportError: cannot import name 'LazyFixture' from 'pytest'"},{"fix":"Pass the fixture name as a string: lazy_fixture('my_fixture')","cause":"lazy_fixture expects a string fixture name, not a fixture function.","error":"TypeError: lazy_fixture() missing 1 required positional argument: 'name'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}