pytest-lazy-fixtures
Allows you to use fixtures in @pytest.mark.parametrize.
Decision gist · record as of 2026-08-14
Yes. The package solves a genuine pytest limitation with low install friction, active maintenance, no known vulnerabilities, and a permissive MIT license. It is well-suited for projects that need to parametrize tests with fixture-derived values.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires pytest as a runtime dependency.
- Low friction install with a single runtime dependency on pytest.
- Actively maintained with last commit 2026-08-12 and 113 repository stars.
License · maintenance · safety
MIT (permissive) — MIT license permits free use, modification, and distribution with minimal restrictions—suitable for both open-source and commercial projects.
last release 2026-08-12 (2 days) · last repo commit 2026-08-12 · 113 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 2,186,025 downloads/mo, #3,225 on PyPI
Alternatives
Verify before relying
pip install pytest-lazy-fixtures
import pytest
from pytest_lazy_fixtures import lf
@pytest.fixture()
def one():
return 1
@pytest.mark.parametrize('arg1,arg2', [('val1', lf('one'))])
def test_func(arg1, arg2):
assert arg2 == 1- Whether implicit fixture injection from callable signatures works reliably across all pytest versions.
- Performance impact when parametrizing tests with large numbers of lazy fixture references.
What it is and what it does
pytest-lazy-fixtures extends pytest's parametrize decorator to accept fixture references as parameter values, solving the limitation that fixtures cannot normally be used directly in @pytest.mark.parametrize. It provides two main tools: lf (lazy_fixture) for simple fixture references and lfc (lazy_fixture_callable) for wrapping callables that should receive fixture values. The package supports fixtures nested in data structures (lists, dicts, tuples), attribute access via dot notation (e.g., lf('fixture.attr')), and automatic parameter injection based on callable signatures.
The package depends only on pytest and is compatible with other pytest plugins. It targets Python 3.8 and above and is distributed under the MIT license, making it suitable for most projects.
Use it for
- Parametrize tests with fixture-derived values without duplicating fixture logic in test parameters.
- Test multiple scenarios where each scenario needs a fresh instance of a complex fixture object.
- Build parametrized test cases that reference fixture attributes or call fixture methods.
- Use fixtures as arguments to custom callables within parametrize, enabling flexible test data composition.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
The package solves a genuine pytest limitation with low install friction, active maintenance, no known vulnerabilities, and a permissive MIT license. It is well-suited for projects that need to parametrize tests with fixture-derived values.
Install
pytest-lazy-fixtures on PyPI
Before you install
Low friction install with a single runtime dependency on pytest. Actively maintained with last commit 2026-08-12 and 113 repository stars.
Requires pytest as a runtime dependency.
License in practice
MIT license permits free use, modification, and distribution with minimal restrictions—suitable for both open-source and commercial projects.
Quickstart
pip install pytest-lazy-fixtures
import pytest
from pytest_lazy_fixtures import lf
@pytest.fixture()
def one():
return 1
@pytest.mark.parametrize('arg1,arg2', [('val1', lf('one'))])
def test_func(arg1, arg2):
assert arg2 == 1
Verify before relying
- Whether implicit fixture injection from callable signatures works reliably across all pytest versions.
- Performance impact when parametrizing tests with large numbers of lazy fixture references.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.8 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packagepytest |
| Maintenance | Actively maintained 2 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 2,186,025 / month, #3,225 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
Evidence: pytest_lazy_fixtures-1.4.1-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “pytest parametrize with fixtures”
- pytest-lazy-fixturesAllows you to reference pytest fixtures directly within…
- pytest-lazy-fixtureAllows you to use pytest fixtures directly as parameters in…
- pytest-casespytest-cases lets you separate test case data from test code in…
Give your agent the search over MCP, or paste the wish link into any chat.
More Testing packages
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
pytest is a testing framework that lets you write test functions using plain assert statements and automatically discovers and runs them, with detailed failure reporting.
virtualenv creates isolated Python environments where packages can be installed independently without affecting the system Python or other projects.
Coverage.py measures which lines of Python code are executed during test runs, reporting coverage percentages and identifying untested code paths.
Install it if you want to measure test completeness or enforce coverage thresholds in your project.
pytest-asyncio is a pytest plugin that enables writing and running async test functions using the asyncio library, allowing developers to await code directly within test cases.
Install it if you write tests for any asyncio-based code.
A pytest plugin that generates test reports in Common Test Report Format (CTRF) as JSON, compatible with pytest-xdist and pytest-playwright for distributed and browser-based testing.
Install it if you need CTRF-formatted test output for CI/CD integration or cross-tool reporting.
See also pytest-lazy-fixture · pytest-print · pytest-cases · fixtures · pytest-fixture-config · pytest-deadfixtures · pytest-factoryboy · pytest-unused-fixtures · parametrize · deadline-cloud-test-fixtures