From b0132f0600cb6f867e6f45b37f2acf2d32a49c59 Mon Sep 17 00:00:00 2001 From: Ryan Forsyth Date: Wed, 1 Oct 2025 12:14:02 -0500 Subject: [PATCH] Further test fixes --- tests/integration/test_bash_generation.py | 2 +- tests/integration/test_campaign.py | 17 +++++++++++------ tests/integration/test_defaults.py | 2 +- tests/integration/test_last_year.py | 2 +- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/tests/integration/test_bash_generation.py b/tests/integration/test_bash_generation.py index f9b2a3b9..62b3be62 100644 --- a/tests/integration/test_bash_generation.py +++ b/tests/integration/test_bash_generation.py @@ -6,7 +6,7 @@ def test_bash_generation(): # cfg is not machine-specific assert os.system("zppy -c tests/integration/test_bash_generation.cfg") == 0 - assert os.system("rm test_bash_generation_output/post/scripts/provenance*") == 0 + assert os.system("rm -rf test_bash_generation_output/post/scripts/provenance*") == 0 expected_dir = get_expansions()["expected_dir"] assert ( os.system( diff --git a/tests/integration/test_campaign.py b/tests/integration/test_campaign.py index ccf49e76..c754dd3e 100644 --- a/tests/integration/test_campaign.py +++ b/tests/integration/test_campaign.py @@ -7,7 +7,10 @@ def test_campaign_cryosphere(): assert os.system("zppy -c tests/integration/test_campaign_cryosphere.cfg") == 0 assert os.system("rm test_campaign_cryosphere_output/post/scripts/*.bash") == 0 - assert os.system("rm test_campaign_cryosphere_output/post/scripts/provenance*") == 0 + assert ( + os.system("rm -rf test_campaign_cryosphere_output/post/scripts/provenance*") + == 0 + ) expected_dir = get_expansions()["expected_dir"] assert ( os.system( @@ -29,7 +32,7 @@ def test_campaign_cryosphere_override(): ) assert ( os.system( - "rm test_campaign_cryosphere_override_output/post/scripts/provenance*" + "rm -rf test_campaign_cryosphere_override_output/post/scripts/provenance*" ) == 0 ) @@ -47,7 +50,8 @@ def test_campaign_high_res_v1(): assert os.system("zppy -c tests/integration/test_campaign_high_res_v1.cfg") == 0 assert os.system("rm test_campaign_high_res_v1_output/post/scripts/*.bash") == 0 assert ( - os.system("rm test_campaign_high_res_v1_output/post/scripts/provenance*") == 0 + os.system("rm -rf test_campaign_high_res_v1_output/post/scripts/provenance*") + == 0 ) expected_dir = get_expansions()["expected_dir"] assert ( @@ -62,7 +66,7 @@ def test_campaign_high_res_v1(): def test_campaign_none(): assert os.system("zppy -c tests/integration/test_campaign_none.cfg") == 0 assert os.system("rm test_campaign_none_output/post/scripts/*.bash") == 0 - assert os.system("rm test_campaign_none_output/post/scripts/provenance*") == 0 + assert os.system("rm -rf test_campaign_none_output/post/scripts/provenance*") == 0 expected_dir = get_expansions()["expected_dir"] assert ( os.system( @@ -77,7 +81,8 @@ def test_campaign_water_cycle(): assert os.system("zppy -c tests/integration/test_campaign_water_cycle.cfg") == 0 assert os.system("rm test_campaign_water_cycle_output/post/scripts/*.bash") == 0 assert ( - os.system("rm test_campaign_water_cycle_output/post/scripts/provenance*") == 0 + os.system("rm -rf test_campaign_water_cycle_output/post/scripts/provenance*") + == 0 ) expected_dir = get_expansions()["expected_dir"] assert ( @@ -100,7 +105,7 @@ def test_campaign_water_cycle_override(): ) assert ( os.system( - "rm test_campaign_water_cycle_override_output/post/scripts/provenance*" + "rm -rf test_campaign_water_cycle_override_output/post/scripts/provenance*" ) == 0 ) diff --git a/tests/integration/test_defaults.py b/tests/integration/test_defaults.py index d2fc1c68..33eb0bac 100644 --- a/tests/integration/test_defaults.py +++ b/tests/integration/test_defaults.py @@ -7,7 +7,7 @@ def test_defaults(): # cfg is not machine-specific assert os.system("zppy -c tests/integration/test_defaults.cfg") == 0 assert os.system("rm test_defaults_output/post/scripts/*.bash") == 0 - assert os.system("rm test_defaults_output/post/scripts/provenance*") == 0 + assert os.system("rm -rf test_defaults_output/post/scripts/provenance*") == 0 assert ( os.system( "rm -rf test_defaults_output/post/scripts/global_time_series_0001-0020_dir" diff --git a/tests/integration/test_last_year.py b/tests/integration/test_last_year.py index 281bc0e7..1c617d8d 100644 --- a/tests/integration/test_last_year.py +++ b/tests/integration/test_last_year.py @@ -9,7 +9,7 @@ def test_last_year(): assert os.system("zppy -c tests/integration/test_last_year.cfg --last-year 12") == 0 # Remove files that are not deterministic: assert os.system("rm test_last_year_output/post/scripts/*.settings") == 0 - assert os.system("rm test_last_year_output/post/scripts/provenance*") == 0 + assert os.system("rm -rf test_last_year_output/post/scripts/provenance*") == 0 actual_files = sorted(os.listdir("test_last_year_output/post/scripts")) expected_files = [ "climo_atm_monthly_180x360_aave_0001-0010.bash",