Skip to content

Commit

Permalink
#223 Move os.environ["HOME"] to be inside test
Browse files Browse the repository at this point in the history
  • Loading branch information
singhd789 committed Nov 4, 2024
1 parent 9fb27cc commit b814b99
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion fre/make/tests/test_create_makefile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
"""
Expand All @@ -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}"
Expand Down
5 changes: 4 additions & 1 deletion fre/pp/tests/test_configure_script_yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
"""
Expand All @@ -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
Expand Down

0 comments on commit b814b99

Please sign in to comment.