Skip to content
This repository was archived by the owner on Aug 13, 2025. It is now read-only.

Commit 0df2ea8

Browse files
committed
Ignore tempdirs during pytest collection phase
(cherry picked from commit 8a406b7)
1 parent b8d6434 commit 0df2ea8

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

bin/tests/system/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@ parallel.mk
2222
/start.sh
2323
/stop.sh
2424
/ifconfig.sh
25+
/*_tmp_*

bin/tests/system/conftest.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,14 @@ def pytest_configure():
156156
raise exc
157157
logging.debug(proc.stdout)
158158

159+
def pytest_ignore_collect(path):
160+
# System tests are executed in temporary directories inside
161+
# bin/tests/system. These temporary directories contain all files
162+
# needed for the system tests - including tests_*.py files. Make sure to
163+
# ignore these during test collection phase. Otherwise, test artifacts
164+
# from previous runs could mess with the runner.
165+
return "_tmp_" in str(path)
166+
159167
@pytest.hookimpl(tryfirst=True, hookwrapper=True)
160168
def pytest_runtest_makereport(item):
161169
"""Hook that is used to expose test results to session (for use in fixtures)."""

0 commit comments

Comments
 (0)