I have some tests which I would like to repeat a number of times. I tried the pytest-repeat plugin
pip3 install pytest-repeat
import pytest
@pytest.mark.repeat(2)
class TestDemo():
def test_demo1(self):
pass
def test_demo2(self):
pass
This works
test_class_repeat.py::TestDemo::test_demo1[1/2] PASSED
test_class_repeat.py::TestDemo::test_demo1[2/2] PASSED
test_class_repeat.py::TestDemo::test_demo2[1/2] PASSED
test_class_repeat.py::TestDemo::test_demo2[2/2] PASSED
Except that I want an interleaved order running all tests, and the run all tests again
test_class_repeat.py::TestDemo::test_demo1[1/2] PASSED
test_class_repeat.py::TestDemo::test_demo2[1/2] PASSED
test_class_repeat.py::TestDemo::test_demo1[2/2] PASSED
test_class_repeat.py::TestDemo::test_demo2[2/2] PASSED
Is there a simple way to do this?