fix: one failure line per file, tests stay local

This commit is contained in:
Abdessamad Derraz committed 2026-11-03 14:31:49 +01:00
1 parent 2478c2a96c
commit 27bd4f1a50
8 files changed
+85 -23

No files matched your search

+3 -1
View File
@@ -27,7 +27,9 @@ _SAVED: dict = {}
def _refuse(host: object) -> None:
where = os.environ.get(NETLOG)
if where:
# A name under .invalid never resolves (RFC 2606): a test names one to
# fail on purpose, refused here before its DNS query leaves.
if where and not str(host).endswith(".invalid"):
with open(where, "a", encoding="utf-8") as log:
log.write(f"{os.getpid()} {host} {' '.join(sys.argv)[:300]}\n")
raise OSError(errno.ENETUNREACH, f"a test makes no request to {host}")