-
Notifications
You must be signed in to change notification settings - Fork 39
Open
Description
Is there any intent to reorder test execution according to dependencies? The current behavior I observe is that if I have two tests, where the first depends on the second, the first is just skipped. It would be preferable to reorder them so that they can both execute, rather than relying on source code order.
import pytest
@pytest.mark.dependency(depends=["test_parent"])
def test_child():
pass
@pytest.mark.dependency
def test_parent():
pass
$ pytest
==== test session starts ====
platform linux -- Python 3.6.4, pytest-3.5.0, py-1.5.3, pluggy-0.6.0 -- /usr/local/bin/python
cachedir: .pytest_cache
rootdir: /tests, inifile:
plugins: dependency-0.3.2
collected 2 items
test_file.py::test_child SKIPPED
test_file.py::test_parent PASSED
==== 2 passed, 1 skipped in 0.01 seconds ====
NOTE: https://github.com/ftobia/pytest-ordering does some of this, but requires explicit ordering. I'd rather just define the dependencies and let the system figure it out.
exhuma, DevilXD, phyrwork, DaLynX, axel-h and 1 more
Metadata
Metadata
Assignees
Labels
No labels