PyTest: Force default order
If for some reason we would like to make sure the order remains the same, in a given module, we can add the following two lines of code.
import pytest pytestmark = pytest.mark.random_order(disabled=True)
examples/pytest/order/test_default_order.py
import pytest pytestmark = pytest.mark.random_order(disabled=True) def test_one(): assert True def test_two(): assert True def test_three(): assert True