pytest-dev / pytest-repeat

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

Feature request: class level repeat #45

Closed adamf663 closed 1 year ago

adamf663 commented 4 years ago

I have a class where scripts are dependent on prior results. For class C, scripts S1, S2, S3 to run in order.

Putting the pytest.mark.repeat on the class doesn't result in repeating the class, but in repeating each test N times.
With '@pytest.mark.repeat(3)', the result is C.S1, C.S1, C.S1, C.S2, C.S2, C.S2, C.S3, C.S3, C.S3. What I need is: C.S1, C.S2, C.S3, C.S1, C.S2, C.S3,...

GabrielKis commented 4 years ago

If I'm not wrong I think this feature already exists. Have you tried --repeat-scope=class when executing your tests?

okken commented 1 year ago

yes. Seems like --repeat-scope=class works. One problem is that --repeat-scope is undocumented in README. I've filed issue #61 to address that.

okken commented 1 year ago

This issue can be closed