Skip to content

Commit

Permalink
Avoid misuse of pytest.mark.xfail in pyscal test
Browse files Browse the repository at this point in the history
Test this SystemExit explicitly instead as it is not going to change.
  • Loading branch information
berland committed Oct 28, 2024
1 parent caf3a5d commit 0607669
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions tests/forward_models/pyscal/test_pyscal.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,6 @@
[
(EXAMPLE_STATIC_DFRAME, ["__NONE__", "__NONE__", "__NONE__", "sgof", 1]),
(EXAMPLE_STATIC_DFRAME, ["__NONE__", "__NONE__", "__NONE__", "slgof", 1]),
pytest.param(
EXAMPLE_STATIC_DFRAME,
["__NONE__", "__NONE__", "__NONE__", "slgof", 2],
marks=pytest.mark.xfail(raises=SystemExit),
id="SLGOF_family_2_not_meaningful",
),
(EXAMPLE_STATIC_DFRAME, ["__NONE__", "__NONE__", "__NONE__", "sgof", 2]),
(EXAMPLE_WATEROIL, ["__NONE__", "__NONE__", "__NONE__", "sgof", 1]),
(EXAMPLE_SCAL, ["__NONE__", "INTERPOLATE_WO", "INTERPOLATE_GO", "sgof", 1]),
Expand Down Expand Up @@ -66,6 +60,21 @@ def test_fm_pyscal(dframe, runargs, tmpdir):
assert len(Path("relperm.inc").read_text(encoding="utf-8")) > 20


def test_fm_pyscal_errors_on_slgof_family_2(tmpdir):
tmpdir.chdir()
EXAMPLE_STATIC_DFRAME.to_csv("relperm-input.csv", index=False)
with pytest.raises(SystemExit):
run(
"relperm-input.csv",
"relperm.inc",
"__NONE__",
"__NONE__",
"__NONE__",
"slgof",
2,
)


def test_fm_pysal_static_xlsx(tmpdir):
"""Test fm_pyscal on a static xlsx file"""
tmpdir.chdir()
Expand Down

0 comments on commit 0607669

Please sign in to comment.