pytest-xdist icon indicating copy to clipboard operation
pytest-xdist copied to clipboard

Have pytest-xdist respect the order set by pytest-order

Open albertino87 opened this issue 1 year ago • 1 comments

Is there any chance to make pytest-xdist respect the order set by pytest-order (just the priority order):

@pytest.mark.order(2)
def test_foo():
    assert True

@pytest.mark.order(1)
def test_bar():
    assert True

NOT the dependency order:

@pytest.mark.dependency(depends=["test_b"])
def test_a():
    assert True

@pytest.mark.dependency
def test_b():
    assert True

@pytest.mark.order(after="test_module2.py::test1")
def test1():
    pass

def test2():
    pass

or implement a similar behaviour directly in pytest-xdist? the current available options are not good enough, i have to be sure the slowest tests run first (and i know that in advance) to optimise the test time, distributing them according to the file or group is not ensuring this behaviour. I also can't use this plugin: https://github.com/klimkin/pytest-slowest-first because it requires the tests to have run before but the machine on which my tests run is a clean machine every time. Many thanks

albertino87 avatar Jun 14 '24 08:06 albertino87

It used to do this before 3.5. I think resolving this issue will return the behavior. https://github.com/pytest-dev/pytest-xdist/issues/1083

Hyzerputt avatar Oct 15 '24 16:10 Hyzerputt