Skip to content

Commit

Permalink
Merge branch '2.7' into backport-9272-to-2.7
Browse files Browse the repository at this point in the history
  • Loading branch information
brettlangdon authored May 28, 2024
2 parents 83eb19f + 3d33fb1 commit ffecbec
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,18 @@ def _subprocess_wrapper():
return _subprocess_wrapper()


@pytest.hookimpl(tryfirst=True)
def pytest_collection_modifyitems(session, config, items):
"""Don't let ITR skip tests that use the subprocess marker because coverage collection in subprocesses is broken"""
for item in items:
if item.get_closest_marker("subprocess"):
if item.get_closest_marker("skipif"):
# Respect any existing skipif marker because they preempt ITR's decision-making
continue
unskippable = pytest.mark.skipif(False, reason="datadog_itr_unskippable")
item.add_marker(unskippable)


@pytest.hookimpl(tryfirst=True)
def pytest_runtest_protocol(item):
if item.get_closest_marker("skip"):
Expand Down

0 comments on commit ffecbec

Please sign in to comment.