From 387005753f37013cd362c3b45c92b4e6d8b4d83b Mon Sep 17 00:00:00 2001 From: iamashwin99 <ashwin-kumar.karnad@mpsd.mpg.de> Date: Tue, 9 May 2023 14:06:47 +0200 Subject: [PATCH] use pathlib more frequently --- tests.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests.py b/tests.py index 0f9392d..bc9c8bb 100644 --- a/tests.py +++ b/tests.py @@ -36,14 +36,14 @@ def test_prepare_environment(tmp_path): assert not script_dir.exists() result = mod.prepare_environment( - mpsd_release=mpsd_release_to_test, script_dir=str(script_dir) + mpsd_release=mpsd_release_to_test, script_dir=(script_dir) ) # wait for 20 seconds for the git clone to finish # time.sleep(20) # check if the directory now is created assert release_base_dir.exists() # check for spack-environments directory - assert spack_environments in os.listdir(str(release_base_dir)) + assert spack_environments in os.listdir(release_base_dir) # check if the git branch is correctly checked out assert ( subprocess.run( @@ -71,7 +71,7 @@ def test_setup_log_cmd(tmp_path): # run the prepare_env functionality mod.prepare_env( - toolchain_base_dir=str(tmp_path), + toolchain_base_dir=(tmp_path), mpsd_spack_ver="dev-23a", skip_dir_check=False, shared_var=shared_var, @@ -81,6 +81,7 @@ def test_setup_log_cmd(tmp_path): assert os.path.exists("logs/install-software-environment.log") assert os.path.getsize("logs/install-software-environment.log") > initial_bytes + def test_install_environment(tmp_path): # Expect and Exception when wrong toolchains are provided with pytest.raises(Exception): -- GitLab