diff --git a/tests.py b/tests.py
index ec01d015197f2d6a34bf469e409c304b95815536..62e9bc7f7726c8e423d3f97b78006ac24a6739c5 100644
--- a/tests.py
+++ b/tests.py
@@ -338,7 +338,7 @@ def test_metadata_logging(tmp_path):
         logging.warning("Add some other info")
 
     # Check that relevant lines show up in the log file somewhere
-    with open(tmp_path / "test-metadata.log", "r") as f:
+    with open(filename, "r") as f:
         logfile_content = f.read()
         for expected_log in expected_log_entries:
             assert expected_log in logfile_content