diff --git a/tests.py b/tests.py
index 73b881bb9b18d24d0d714628baff94f09f7a3e69..31d578fed2b66416f112a0a6fe0b59985e027b35 100644
--- a/tests.py
+++ b/tests.py
@@ -180,6 +180,7 @@ def test_install_environment(tmp_path):
     with open(build_log, "r") as f:
         lines = f.read()
         assert "##### Installation finished" in lines
+    build_log_file_name = os.path.basename(build_log)
 
     # assert that install log files exists
     assert os.path.exists(release_base_dir / "install.log")
@@ -189,7 +190,7 @@ def test_install_environment(tmp_path):
     with open(release_base_dir / "install.log", "r") as f:
         lines = f.read()
         assert (
-            "installing {toolchain_to_test} and logging at logs/{build_log_file_name}"
+            f"installing {toolchain_to_test} and logging at logs/{build_log_file_name}"
             in lines
         )
     # assert that the module files are created correctly