@@ -37,7 +37,7 @@ def quickstart_model():
3737 return gwf
3838
3939
40- def test_flopy3_model ():
40+ def test_flopy3_model (tmp_path ):
4141 from flopy .mbase import ModelInterface
4242 from flopy .pakbase import PackageInterface
4343
@@ -114,12 +114,12 @@ def test_flopy3_model():
114114 print (f"data_type: { d .data_type } " )
115115 print (f"array: { d .array } \n " )
116116
117- bpth = Path ("output/ flopy3_model/ flopy3_model")
118- Path ("output/ flopy3_model" ).mkdir (parents = True , exist_ok = True )
117+ bpth = Path (tmp_path ) / " flopy3_model" / " flopy3_model"
118+ ( Path (tmp_path ) / " flopy3_model" ).mkdir (parents = True , exist_ok = True )
119119 gwf3 .plot (filename_base = bpth )
120120
121121
122- def test_flopy3_package ():
122+ def test_flopy3_package (tmp_path ):
123123 from flopy .mbase import ModelInterface
124124 from flopy .pakbase import PackageInterface
125125
@@ -236,12 +236,12 @@ def test_flopy3_package():
236236 if di .name == k :
237237 assert np .all (np .equal (di .array , v ))
238238
239- bpth = Path ("output/ flopy3_package/ flopy3_package")
240- Path ("output/ flopy3_package" ).mkdir (parents = True , exist_ok = True )
239+ bpth = Path (tmp_path ) / " flopy3_package" / " flopy3_package"
240+ ( Path (tmp_path ) / " flopy3_package" ).mkdir (parents = True , exist_ok = True )
241241 dis3 .plot (filename_base = bpth )
242242
243243
244- def norun_test_flopy3_cbd_small ():
244+ def norun_test_flopy3_cbd_small (tmp_path ):
245245 import sys
246246
247247 sys .path .append ("/home/mjreno/.clone/usgs/flopy/autotest" )
@@ -262,13 +262,13 @@ def norun_test_flopy3_cbd_small():
262262 dis = dis ,
263263 dims = dims ,
264264 )
265- bpth = Path ("output/ flopy3_cbd_small/ flopy3_cbd_small")
266- Path ("output/ flopy3_cbd_small" ).mkdir (parents = True , exist_ok = True )
265+ bpth = Path (tmp_path ) / " flopy3_cbd_small" / " flopy3_cbd_small"
266+ ( Path (tmp_path ) / " flopy3_cbd_small" ).mkdir (parents = True , exist_ok = True )
267267 gwf3 = Flopy3Model (model = gwf , modelgrid = cbd_small , modeltime = time )
268268 gwf3 .plot (filename_base = bpth )
269269
270270
271- def test_flopy3_grid2 ():
271+ def test_flopy3_grid2 (tmp_path ):
272272 lx = 5.0
273273 lz = 1.0
274274 nlay = 1
@@ -303,18 +303,18 @@ def test_flopy3_grid2():
303303 dis = dis ,
304304 dims = dims ,
305305 )
306- bpth = Path ("output/ flopy3_grid2/ flopy3_grid2")
307- Path ("output/ flopy3_grid2" ).mkdir (parents = True , exist_ok = True )
306+ bpth = Path (tmp_path ) / " flopy3_grid2" / " flopy3_grid2"
307+ ( Path (tmp_path ) / " flopy3_grid2" ).mkdir (parents = True , exist_ok = True )
308308 gwf3 = Flopy3Model (model = gwf , modeltime = time )
309309 gwf3 .plot (filename_base = bpth )
310310
311311
312- def test_flopy3_export ():
312+ def test_flopy3_export (tmp_path ):
313313 # see flopy test_export.py test_export_output()
314- Path ("output/ flopy3_model/ shape" ).mkdir (parents = True , exist_ok = True )
315- Path ("output/ flopy3_package/shape" ).mkdir (parents = True , exist_ok = True )
316- Path ("output/ flopy3_model/netcdf" ).mkdir (parents = True , exist_ok = True )
317- Path ("output/ flopy3_package/netcdf" ).mkdir (parents = True , exist_ok = True )
314+ ( Path (tmp_path ) / " flopy3_model" / " shape" ).mkdir (parents = True , exist_ok = True )
315+ ( Path (tmp_path ) / " flopy3_package/shape" ).mkdir (parents = True , exist_ok = True )
316+ ( Path (tmp_path ) / " flopy3_model/netcdf" ).mkdir (parents = True , exist_ok = True )
317+ ( Path (tmp_path ) / " flopy3_package/netcdf" ).mkdir (parents = True , exist_ok = True )
318318
319319 time = ModelTime (perlen = [1.0 ], nstp = [1 ], tsmult = [1.0 ])
320320
@@ -323,20 +323,20 @@ def test_flopy3_export():
323323 dis3 = Flopy3Package (gwf .dis , model = gwf3 )
324324
325325 # model shapefile export
326- shp_mpth = Path ("output/ flopy3_model/ shape/ flopy3_model.shp" )
326+ shp_mpth = Path (tmp_path / " flopy3_model" / " shape" / " flopy3_model.shp" )
327327 gwf3 .export (f = shp_mpth )
328328
329329 # package shapefile export
330- shp_ppth = Path ("output/ flopy3_package/ shape/ flopy3_package.shp" )
330+ shp_ppth = Path (tmp_path / " flopy3_package" / " shape" / " flopy3_package.shp" )
331331 dis3 .export (f = shp_ppth )
332332
333333 # model netcdf export
334- nc_mpth = Path ("output/ flopy3_model/ netcdf/ flopy3_model.nc" )
334+ nc_mpth = Path (tmp_path / " flopy3_model" / " netcdf" / " flopy3_model.nc" )
335335 # TODO: needs flopy3 fix
336336 # gwf3.export(f=nc_mpth)
337337
338338 # package netcdf export
339- nc_ppth = Path ("output/ flopy3_package/ netcdf/ flopy3_package.nc" )
339+ nc_ppth = Path (tmp_path / " flopy3_package" / " netcdf" / " flopy3_package.nc" )
340340 # TODO: needs flopy3 fix
341341 # dis3.export(f=nc_ppth)
342342
0 commit comments