Releases: seandstewart/pytest-parametrize-suite
Releases · seandstewart/pytest-parametrize-suite
Allow multiple `suite` markers to build a test matrix.
What's New
Now you can stack suite
markers on your test and the tests will generate a cross-product of the cominations, just like the parametrize
marker.
Example
The following test:
@pytest.mark.suite(
case1=dict(arg1="cross1"),
case2=dict(arg1="cross2"),
)
@pytest.mark.suite(
case3=dict(arg2="product1"),
case4=dict(arg2="product2"),
)
def test_suite_matrix(arg1, arg2):
# Given
combination = arg1 + arg2
# When
possible_combinations.remove(combination)
# Then
assert combination not in possible_combinations
possible_combinations = {
"cross1product1",
"cross1product2",
"cross2product1",
"cross2product2",
}
Generates the follwing output:
poetry run coverage run --rcfile=.coveragerc -m pytest . -v
=========================== test session starts ===========================
...
tests/test_plugin.py::test_suite_matrix[case3-case1] PASSED [ 61%]
tests/test_plugin.py::test_suite_matrix[case3-case2] PASSED [ 69%]
tests/test_plugin.py::test_suite_matrix[case4-case1] PASSED [ 76%]
tests/test_plugin.py::test_suite_matrix[case4-case2] PASSED [ 84%]
...
Relax Python Version Constraint to >3.8.1
v23.1.1 bump version to v23.1.1 [ci skip]
Initial Release
v23.1.0 Add badges