{"id":3775,"library":"pytest-lazy-fixture","title":"Pytest Lazy Fixture","description":"pytest-lazy-fixture is a plugin for the pytest testing framework that allows users to pass fixtures as values directly within `pytest.mark.parametrize` decorators. This simplifies test parameterization by enabling the reuse of fixtures where direct fixture injection is not typically supported. The current version is 0.6.3, but the library is no longer actively maintained and has known compatibility issues with newer pytest versions.","status":"deprecated","version":"0.6.3","language":"en","source_language":"en","source_url":"https://github.com/tvorog/pytest-lazy-fixture","tags":["pytest","testing","fixtures","parametrize","plugin","deprecated"],"install":[{"cmd":"pip install pytest-lazy-fixture","lang":"bash","label":"Install stable version"}],"dependencies":[{"reason":"Core testing framework; 'pytest-lazy-fixture' is a plugin for it.","package":"pytest","optional":false}],"imports":[{"note":"This is the primary function used to wrap fixture names for parameterization.","symbol":"lazy_fixture","correct":"from pytest_lazyfixture import lazy_fixture"}],"quickstart":{"code":"import pytest\nfrom pytest_lazyfixture import lazy_fixture\n\n@pytest.fixture\ndef my_fixture():\n    return 'Hello from fixture!'\n\n@pytest.mark.parametrize('param_arg', [lazy_fixture('my_fixture')])\ndef test_example(param_arg):\n    assert param_arg == 'Hello from fixture!'\n\n# To run this, save as a .py file (e.g., test_lazy.py) and run 'pytest'","lang":"python","description":"This quickstart demonstrates how to use `lazy_fixture` to pass the return value of `my_fixture` as a parameter to `test_example` using `pytest.mark.parametrize`."},"warnings":[{"fix":"Downgrade pytest to a version below 8.0.0 (e.g., `pytest==7.3.2`) or consider migrating to an actively maintained alternative like `pytest-lazy-fixtures` (note the 's').","message":"pytest-lazy-fixture is incompatible with pytest versions 8.0.0 and newer. Attempting to use it with these versions will lead to test failures.","severity":"breaking","affected_versions":"pytest >= 8.0.0"},{"fix":"It is highly recommended to migrate to `pytest-lazy-fixtures` (note the 's'), which is a community-maintained fork offering similar functionality and active development. Alternatively, consider using `request.getfixturevalue` for basic cases or redesigning tests to avoid this pattern if possible.","message":"The `pytest-lazy-fixture` library is no longer actively maintained. This means new features, bug fixes, or compatibility updates for newer pytest versions are unlikely.","severity":"deprecated","affected_versions":"All versions"},{"fix":"Be aware of the execution timing. If you need fixture values to influence test collection or other pre-execution steps, `lazy_fixture` is not the appropriate tool.","message":"Fixtures used with `lazy_fixture` are resolved during test execution, not at collection time. This means you cannot use `lazy_fixture` to define parameters that are evaluated during the pytest collection phase for certain advanced scenarios.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Ensure your pytest version is 3.3.0 or higher when using pytest-lazy-fixture >= 0.4.0.","message":"Version 0.4.0 introduced a requirement for `pytest >= 3.3.0`. Older pytest versions will not be compatible with `pytest-lazy-fixture` versions 0.4.0 and above.","severity":"breaking","affected_versions":"< 0.4.0"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}