diff --git a/test/test_checkArgs.py b/test/test_checkArgs.py index 9f210ee8..a66a5777 100644 --- a/test/test_checkArgs.py +++ b/test/test_checkArgs.py @@ -78,12 +78,12 @@ def test_checkArgs_outfmt_4(args): assert argDict.aoi.type()=='radar_rasters' -def test_checkArgs_outfmt_5(args): - '''Test that passing a raster format with height levels throws an error''' - args = args - args.aoi = StationFile(os.path.join(SCENARIO_2, 'stations.csv')) - argDict = checkArgs(args) - assert pd.read_csv(argDict['wetFilenames'][0]).shape == (8, 4) +def test_checkArgs_outfmt_5(args, tmp_path): + with pushd(tmp_path): + args = args + args.aoi = StationFile(os.path.join(SCENARIO_2, 'stations.csv')) + argDict = checkArgs(args) + assert pd.read_csv(argDict['wetFilenames'][0]).shape == (8, 4) def test_checkArgs_outloc_1(args): diff --git a/test/test_datelist.py b/test/test_datelist.py index 59166faa..333f3f05 100644 --- a/test/test_datelist.py +++ b/test/test_datelist.py @@ -27,9 +27,13 @@ def test_datelist(): } cfg = update_yaml(dct_group, 'temp.yaml') + file_to_del = 'temp.yaml' param_dict = read_run_config_file(cfg) assert param_dict['date_list'] == true_dates + if os.path.exists(file_to_del): + os.remove(file_to_del) + def test_datestep(): SCENARIO_DIR = os.path.join(TEST_DIR, 'scenario_5') @@ -52,5 +56,9 @@ def test_datestep(): } cfg = update_yaml(dct_group, 'temp.yaml') + file_to_del = 'temp.yaml' param_dict = read_run_config_file(cfg) - assert param_dict['date_list'] == true_dates \ No newline at end of file + assert param_dict['date_list'] == true_dates + + if os.path.exists(file_to_del): + os.remove(file_to_del) \ No newline at end of file