From c58e08f80fcf543cce4251934e5495413c619558 Mon Sep 17 00:00:00 2001
From: Simon Rose <simon.rose@ess.eu>
Date: Wed, 1 Dec 2021 14:02:17 +0100
Subject: [PATCH] Use Path.touch() instead of open()

---
 tests/test_build.py | 7 +++----
 tests/utils.py      | 2 +-
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/tests/test_build.py b/tests/test_build.py
index e8db863e..7e9a97d6 100644
--- a/tests/test_build.py
+++ b/tests/test_build.py
@@ -124,11 +124,10 @@ def test_header_install_location(wrapper):
             f.write(f"HEADERS += db/subdir/header.{ext}\n")
         f.write("KEEP_HEADER_SUBDIRS += db\n")
 
-    for extension in extensions:
-        with open(subdir / f"header.{extension}", "w") as f:
-            pass
+    for ext in extensions:
+        (subdir / f"header.{ext}").touch()
 
-    rc, _, _ = run_make(wrapper, "cellinstall")
+    rc, *_ = run_make(wrapper, "cellinstall")
     assert rc == 0
 
     cell_path = get_env_var(wrapper, "E3_MODULES_INSTALL_LOCATION")
diff --git a/tests/utils.py b/tests/utils.py
index 8b23542f..a56ca8b3 100644
--- a/tests/utils.py
+++ b/tests/utils.py
@@ -67,7 +67,7 @@ def get_env_var(path, var: str):
     for line in out.split("\n"):
         if line.startswith(var):
             return line.split("=")[1].strip()
-    assert False
+    return ""
 
 
 def run_ioc_get_output(version, cell_path):
-- 
GitLab