pytest-cases
Separate test code from test cases in pytest.
Separate test code from test cases in pytest.
To install this package, run one of the following:
Did you ever think that most of your test functions were actually the same
test code, but with different data inputs and expected results/exceptions ?
pytest-cases leverages pytest and its great @pytest.mark.parametrize
decorator, so that you can separate your test cases from your test
functions. In addition, pytest-cases provides several useful goodies to
empower pytest. In particular it improves the fixture mechanism to support
"fixture unions". This is a major change in the internal pytest engine,
unlocking many possibilities such as using fixture references as parameter
values in a test function.
Summary
Separate test code from test cases in pytest.
Information Last Updated
Jun 10, 2025 at 07:46
License
BSD-3-Clause
Total Downloads
409.8K
Platforms
GitHub Repository
https://github.com/smarie/python-pytest-casesDocumentation
https://smarie.github.io/python-pytest-cases