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

Commit 8b20cdb

Browse files
committed
Ignore tempdirs during pytest collection phase
1 parent c902fa5 commit 8b20cdb

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
@@ -19,3 +19,4 @@ named.run
1919
/start.sh
2020
/stop.sh
2121
/ifconfig.sh
22+
/*_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)