CMD + K

pytest-cases

Community

Separate test code from test cases in pytest.

Installation

To install this package, run one of the following:

Conda
$conda install conda-forge::pytest-cases

Usage Tracking

3.10.1
3.9.1
3.8.6
3.8.5
3.8.4
5 / 8 versions selected
Downloads (Last 6 months): 0

Description

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.

About

Summary

Separate test code from test cases in pytest.

Last Updated

Mar 9, 2026 at 20:44

License

BSD-3-Clause

Total Downloads

437.2K

Version Downloads

1.2K

Supported Platforms

noarch