Skip to content

Conversation

@gk-sysdig
Copy link

The motivation for this change is if a module, let's call it test_01.py is marked with a dependency like this:

import pytest
pytestmark = [
    pytest.mark.order(1),
    pytest.mark.dependency(name="01_setup", scope="session"),
]

def test_01():
    assert False

def test_01a():
    assert True

Then tests in a dependent test module will run instead of being skipped if test_01 fails.
For example test_02.py:

import pytest
pytestmark = [
    pytest.mark.order(2),
    pytest.mark.dependency(depends=["01_setup"], name="02_setup", scope="session"),
]

def test_02():
    assert True

This PR makes it such that test_02 is skipped if any test fails in test_01.py

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

Successfully merging this pull request may close these issues.

1 participant