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 f3d519c36aa..00b5f835594 100644 --- a/pytest.ini +++ b/pytest.ini @@ -14,3 +14,5 @@ markers = edm4hep odd hepmc3 +filterwarnings = + error