Skip to content

Releases: seandstewart/pytest-parametrize-suite

Allow multiple `suite` markers to build a test matrix.

19 Jan 13:10
Compare
Choose a tag to compare

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

16 Jan 15:46
Compare
Choose a tag to compare
v23.1.1

bump version to v23.1.1 [ci skip]

Initial Release

15 Jan 23:04
Compare
Choose a tag to compare
v23.1.0

Add badges