From b814b99fba1e4be486a2c911f4c5ceb969c195ce Mon Sep 17 00:00:00 2001 From: Dana Singh Date: Mon, 4 Nov 2024 13:02:47 -0500 Subject: [PATCH] #223 Move `os.environ["HOME"]` to be inside test --- fre/make/tests/test_create_makefile.py | 5 ++++- fre/pp/tests/test_configure_script_yaml.py | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/fre/make/tests/test_create_makefile.py b/fre/make/tests/test_create_makefile.py index 63274366..cbb46986 100644 --- a/fre/make/tests/test_create_makefile.py +++ b/fre/make/tests/test_create_makefile.py @@ -27,7 +27,7 @@ Path(out).mkdir(parents=True,exist_ok=True) # Set output directory as home for fre make output -os.environ["HOME"]=str(Path(out)) +#os.environ["HOME"]=str(Path(out)) def test_modelyaml_exists(): """ @@ -51,6 +51,9 @@ def test_bm_makefile_creation(): """ Check the makefile is created when a bare-metal platform is used """ + # Set output directory as home for fre make output + os.environ["HOME"]=str(Path(out)) + bm_plat = BM_PLATFORM[0] targ = TARGET[0] yamlfile_path = f"{test_dir}/{NM_EXAMPLE}/{YAMLFILE}" diff --git a/fre/pp/tests/test_configure_script_yaml.py b/fre/pp/tests/test_configure_script_yaml.py index 1f61efd4..e64cbb7d 100644 --- a/fre/pp/tests/test_configure_script_yaml.py +++ b/fre/pp/tests/test_configure_script_yaml.py @@ -13,7 +13,7 @@ test_yaml = Path(f"AM5_example/am5.yaml") # Set home for ~/cylc-src location in script -os.environ["HOME"]=str(Path(f"{CWD}/{test_dir}/configure_yaml_out")) +#os.environ["HOME"]=str(Path(f"{CWD}/{test_dir}/configure_yaml_out")) def test_combinedyaml_exists(): """ @@ -27,6 +27,9 @@ def test_configure_script(): Creates rose-suite, regrid rose-app, remap rose-app TO-DO: will break this up for better tests """ + # Set home for ~/cylc-src location in script + os.environ["HOME"]=str(Path(f"{CWD}/{test_dir}/configure_yaml_out")) + os.chdir(f"{CWD}/{test_dir}/AM5_example") # Set output directory