Skip to content

Commit

Permalink
fix(tests): use keepable tmpdirs in pytest-cases POC
Browse files Browse the repository at this point in the history
  • Loading branch information
wpbonelli committed Jan 18, 2023
1 parent 5cfeb20 commit 19c9b14
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions autotest/test_gwf_maw04.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,9 @@ def well4(label):

class GwfMaw04Cases:
@parametrize(data=cases, ids=[c.name for c in cases])
def case_4(self, tmpdir, targets, data):
def case_4(self, function_tmpdir, targets, data):
name = data.name
ws = str(tmpdir)
ws = str(function_tmpdir)

# build MODFLOW 6 files
sim = flopy.mf6.MFSimulation(
Expand Down Expand Up @@ -225,7 +225,7 @@ def case_4(self, tmpdir, targets, data):
mc = None
else:
cmppth = "mf2005"
ws = os.path.join(str(tmpdir), cmppth)
ws = os.path.join(str(function_tmpdir), cmppth)
mc = flopy.modflow.Modflow(name, model_ws=ws, version=cmppth)
dis = flopy.modflow.ModflowDis(
mc,
Expand Down
14 changes: 7 additions & 7 deletions autotest/test_gwf_maw_cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,12 @@ class GwfMawCases:
]

@parametrize(data=cases1, ids=[c.name for c in cases1])
def case_1(self, tmpdir, targets, data):
def case_1(self, function_tmpdir, targets, data):
sim = flopy.mf6.MFSimulation(
sim_name=data.name,
version="mf6",
exe_name=targets["mf6"],
sim_ws=str(tmpdir),
sim_ws=str(function_tmpdir),
)

# create tdis package
Expand Down Expand Up @@ -329,9 +329,9 @@ def eval_1(self, config, data):
cases2 = [case2]

@parametrize(data=cases2, ids=[c.name for c in cases2])
def case_2(self, tmpdir, targets, data):
def case_2(self, function_tmpdir, targets, data):
name = data.name
ws = str(tmpdir)
ws = str(function_tmpdir)
sim = flopy.mf6.MFSimulation(
sim_name=name, version="mf6", exe_name=targets["mf6"], sim_ws=ws
)
Expand Down Expand Up @@ -598,7 +598,7 @@ def eval_2(self, config, data):
]

@parametrize(data=cases3, ids=[c.name for c in cases3])
def case_3(self, tmpdir, targets, data):
def case_3(self, function_tmpdir, targets, data):
top = 0.0
botm = [-1000.0]

Expand All @@ -607,7 +607,7 @@ def case_3(self, tmpdir, targets, data):
tdis_rc.append((data.perlen[i], data.nstp[i], data.tsmult[i]))

name = data.name
ws = str(tmpdir)
ws = str(function_tmpdir)
sim = flopy.mf6.MFSimulation(
sim_name=name, sim_ws=ws, exe_name=targets["mf6"]
)
Expand Down Expand Up @@ -810,7 +810,7 @@ def eval_3(self, config, data):
# ]

# @parametrize(data=cases4, ids=[c['name'] for c in cases4])
# def case_4(self, tmpdir, targets, data):
# def case_4(self, function_tmpdir, targets, data):
# pass

# def eval_4(self, sim, data):
Expand Down

0 comments on commit 19c9b14

Please sign in to comment.