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

pytest-ordering doesn't honor test dependencies #58

Open
FFY00 opened this issue Aug 26, 2019 · 5 comments
Open

pytest-ordering doesn't honor test dependencies #58

FFY00 opened this issue Aug 26, 2019 · 5 comments
Labels

Comments

@FFY00
Copy link

FFY00 commented Aug 26, 2019

import pytest

def test_a():
    pass

@pytest.mark.dependency(depends=['test_a'])
@pytest.mark.first
def test_b():
    pass
$ pytest -v -x -s test.py
================================== test session starts ==================================
platform linux -- Python 3.7.4, pytest-5.1.1, py-1.8.0, pluggy-0.12.0 -- /usr/bin/python
cachedir: .pytest_cache
rootdir: /home/anubis/git/ratbag-emu
plugins: ordering-0.6
collected 2 items

test.py::test_b PASSED
test.py::test_a PASSED
@ftobia
Copy link
Owner

ftobia commented Sep 9, 2019

What do you think the behavior should be in this case?

@FFY00
Copy link
Author

FFY00 commented Sep 9, 2019

The dependencies should be run first.

@ftesser
Copy link

ftesser commented Oct 3, 2019

Hi all, I also think that should be very useful to automatically reorder the test execution based on dependencies. Should be nice if pytest-dependency and pytest-ordering will join their efforts.

This issue of pytest-dependency is related: RKrahl/pytest-dependency#20

@phillip-lu-axomic
Copy link

I didn't want a dependency on networkx for @jwineinger 's solution (https://gist.github.com/jwineinger/e41473cd5500554a189d8c97ac28f883), so I rolled my own solution that worked for my (admittedly) not-so-large test set: https://gist.github.com/phillip-lu-axomic/3a8c8c246975667da3162decac9b5f2e

Hopefully this is of some use to others.

@mrbean-bremen
Copy link

mrbean-bremen commented Jan 24, 2021

FWIW, I also added an option to order dependencies in my fork, though it looks like the issue is on the way to be solved in pytest-dependency.

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

No branches or pull requests

5 participants