I would like to repeat a test module N times.
The order is very important.
content of test_stress.py
import pytest
@pytest.mark.usefixtures("class_setup_teardown")
class TestStressRobot:
def test_1(self):
print "\nstressing part 1..."
assert True
def test_2(self):
print "\nstressing part 2..."
assert True
def test_3(self):
print "\nstressing part 3..."
assert True
When I run py.test --repeat=2, the output is:
test_stress.pyTestStressRobot.test_1[0] ✓
test_stress.pyTestStressRobot.test_1[1] ✓
test_stress.pyTestStressRobot.test_2[0] ✓
test_stress.pyTestStressRobot.test_2[1] ✓
test_stress.pyTestStressRobot.test_3[0] ✓
test_stress.pyTestStressRobot.test_3[1] ✓
I don't want it to be repeated per test, but per test module.
Is it possible to have something like that?
test_stress.pyTestStressRobot.test_1[0] ✓
test_stress.pyTestStressRobot.test_2[0] ✓
test_stress.pyTestStressRobot.test_3[0] ✓
test_stress.pyTestStressRobot.test_1[1] ✓
test_stress.pyTestStressRobot.test_2[1] ✓
test_stress.pyTestStressRobot.test_3[1] ✓