From 736dfbbf1edf01e9b83ba8d8d36fdf1df77183aa Mon Sep 17 00:00:00 2001 From: Benjamin Huth Date: Tue, 14 Jul 2026 11:03:34 +0200 Subject: [PATCH 1/2] try it --- pytest.ini | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pytest.ini b/pytest.ini index f3d519c36aa..bc011733f7d 100644 --- a/pytest.ini +++ b/pytest.ini @@ -14,3 +14,5 @@ markers = edm4hep odd hepmc3 +filterwarnings = + error From 61afe657dc7b382b598e7eaef1c5437b57df681e Mon Sep 17 00:00:00 2001 From: Benjamin Huth Date: Tue, 14 Jul 2026 14:15:33 +0200 Subject: [PATCH 2/2] fix(tests): close hash file handle in conftest to avoid ResourceWarning filterwarnings=error promotes the ResourceWarning from the leaked file handle in _parse_hash_file into a hard test error at GC time, failing test_pythia8 in CI. --- Python/Examples/tests/conftest.py | 11 ++++++----- pytest.ini | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Python/Examples/tests/conftest.py b/Python/Examples/tests/conftest.py index c5dfc83d959..ea61e7d3a36 100644 --- a/Python/Examples/tests/conftest.py +++ b/Python/Examples/tests/conftest.py @@ -52,11 +52,12 @@ def __init__( def _parse_hash_file(file: Path) -> Dict[str, str]: res = {} - for line in file.open(): - if line.strip() == "" or line.strip().startswith("#"): - continue - key, h = line.strip().split(":", 1) - res[key.strip()] = h.strip() + with file.open() as f: + for line in f: + if line.strip() == "" or line.strip().startswith("#"): + continue + key, h = line.strip().split(":", 1) + res[key.strip()] = h.strip() return res diff --git a/pytest.ini b/pytest.ini index bc011733f7d..00b5f835594 100644 --- a/pytest.ini +++ b/pytest.ini @@ -14,5 +14,5 @@ markers = edm4hep odd hepmc3 -filterwarnings = +filterwarnings = error