Skip to content

Commit

Permalink
Add test for custom_print
Browse files Browse the repository at this point in the history
Since the `print` function is used, not changes in
the output are expected.`
  • Loading branch information
pya committed Mar 6, 2024
1 parent 0ae36b8 commit 6b88967
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions autotest/test_mbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,3 +160,32 @@ def test_run_model_exe_rel_path(mf6_model_path, function_tmpdir, use_ext):
assert success
assert any(buff)
assert any(ws.glob("*.lst"))


@pytest.mark.mf6
@requires_exe("mf6")
@pytest.mark.parametrize("use_paths", [True, False])
@pytest.mark.parametrize(
"exe",
[
"mf6",
Path(which("mf6") or ""),
relpath_safe(Path(which("mf6") or "")),
],
)
def test_run_model_custom_print(mf6_model_path, function_tmpdir, use_paths, exe):
ws = function_tmpdir / "ws"
copytree(mf6_model_path, ws)

success, buff = run_model(
exe_name=exe,
namefile="mfsim.nam",
model_ws=ws if use_paths else str(ws),
silent=False,
report=True,
custom_print=print,
)

assert success
assert any(buff)
assert any(ws.glob("*.lst"))

0 comments on commit 6b88967

Please sign in to comment.