Skip to content

Commit 40131f0

Browse files
committed
debug: code we can enable to see where tests are running and in what order
1 parent 1761473 commit 40131f0

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

tests/conftest.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
This module is run automatically by pytest, to define and enable fixtures.
88
"""
99

10+
import os
1011
import sys
1112
import warnings
1213

@@ -74,5 +75,12 @@ def reset_sys_path():
7475
def pytest_runtest_call(item):
7576
"""Convert StopEverything into skipped tests."""
7677
outcome = yield
77-
if outcome.excinfo and issubclass(outcome.excinfo[0], StopEverything):
78+
if outcome.excinfo and issubclass(outcome.excinfo[0], StopEverything): # pragma: only jython
7879
pytest.skip(f"Skipping {item.nodeid} for StopEverything: {outcome.excinfo[1]}")
80+
81+
# For diagnosing test running:
82+
if 0:
83+
with open("/tmp/tests.txt", "a") as proctxt:
84+
worker = os.environ.get('PYTEST_XDIST_WORKER', 'none')
85+
test = os.environ.get("PYTEST_CURRENT_TEST", "unknown")
86+
print(f"{worker}: {test}", file=proctxt, flush=True)

0 commit comments

Comments
 (0)