@@ -149,8 +149,8 @@ def rhs_UFD(t, y, eta, epsilon, tau):
149149
150150# Define the expected error in the reconstructions.
151151expected_global_error = 0.053
152- expected_lf_error = 0.12
153- expected_hf_error = 0.19
152+ expected_lf_error = 0.10
153+ expected_hf_error = 0.17
154154expected_transient_error = 0.3
155155
156156# Fit mrCOSTS for testing
@@ -286,13 +286,14 @@ def test_omega_transforms():
286286 )
287287
288288
289- def test_netcdf ():
289+ def test_netcdf (tmp_path ):
290290 """
291291 Test the round trip conversion of the mrCOSTS object to file in
292292 netcdf format and back to mrCOSTS.
293293 """
294- mrc .to_netcdf ("tests" )
295- file_list = glob .glob ("*tests*.nc" )
294+ # Move the I/O tests to the temporary test directory.
295+ mrc .to_netcdf ("tests" , filepath = tmp_path )
296+ file_list = glob .glob (os .path .join (tmp_path , "*tests*.nc" ))
296297 mrc_from_file = mrCOSTS ()
297298 mrc_from_file .from_netcdf (file_list )
298299
@@ -358,10 +359,3 @@ def test_plot_local_time_series():
358359
359360 with raises (ValueError ):
360361 _ = mrc .plot_local_time_series (0 , 0 , data = data .T )
361-
362-
363- def tear_down ():
364- """Remove the files generated in `test_netcdf`"""
365- file_list = glob .glob ("*tests*.nc" )
366- for f in file_list :
367- os .remove (f )
0 commit comments