From f293dd4b51696e1587508e2d646172ea140c9eef Mon Sep 17 00:00:00 2001
From: Hans Fangohr <hans.fangohr@mpsd.mpg.de>
Date: Wed, 31 May 2023 12:35:42 +0200
Subject: [PATCH] move tests that do not need file system out of chdir context

---
 tests.py | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/tests.py b/tests.py
index d3c020e..814f73d 100644
--- a/tests.py
+++ b/tests.py
@@ -26,10 +26,13 @@ def test_os_chdir(tmp_path):
 
 
 def test_run_method(tmp_path):
+    run = mod.run
+
+    # test a command with options:
+    assert run(["date", "+%Y-%m-%d"]).returncode == 0
+    assert run("date +%Y-%m-%d", shell=True).returncode == 0
+
     with mod.os_chdir(str(tmp_path)):
-        run = mod.run
-        # test a command with options:
-        assert run(["date", "+%Y-%m-%d"], shell=True).returncode == 0
         # ensure single string command works
         assert run(("ls -l")).returncode == 0
         # test spaces are handled correctly:
-- 
GitLab