pytest-dev / pytest-repeat

pytest plugin for repeating test execution
https://pypi.python.org/pypi/pytest-repeat/
Other
169 stars 27 forks source link

Using pytest.mark.repeat with pytest parametrize #37

Closed tony-teknique closed 5 years ago

tony-teknique commented 5 years ago

I have been trying to repeat only one of the parameterised tests through pytest.param, but I have not been able to get anywhere. Is it a known limitation with the pytest-repeat plugin?

@pytest.mark.parametrize("name", 
[pytest.param("John", marks=pytest.mark.special), 
pytest.param("Ted", marks=pytest.mark.special), 
pytest.param("Ben", marks=pytest.mark.repeat(10))
])
def test_print_name(name):
    print(name)
RonnyPfannschmidt commented 5 years ago

Pytest-repeat cannot be used indirectly, as parameterization happens before the mark shows

tony-teknique commented 5 years ago

Thanks! That's useful to know.