Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
albertino87 opened this issue Jun 14, 2024 · 1 comment
Open

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

albertino87 opened this issue Jun 14, 2024 · 1 comment

Comments

@albertino87
Copy link

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

@Hyzerputt
Copy link

It used to do this before 3.5. I think resolving this issue will return the behavior. #1083

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants