Skip to content

Commit

Permalink
Merge pull request #269 from neutrinoceros/tst/parametrize_test
Browse files Browse the repository at this point in the history
TST: parametrize a test to check loading with or without directory argument
  • Loading branch information
neutrinoceros authored Mar 23, 2024
2 parents fa95692 + 927ee90 commit 01f23fb
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions tests/test_load_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,26 @@ def test_roundtrip_simple(test_data_dir, tmp_path):
assert dsnpy.nfields == 1


def test_simple_fargo_adsg(test_data_dir):
@pytest.mark.parametrize(
"implicit_directory",
[
pytest.param(True, id="implicit directory"),
pytest.param(False, id="explicit directory"),
],
)
def test_simple_fargo_adsg(test_data_dir, implicit_directory):
data_dir = test_data_dir / "fargo_adsg_planet"
if implicit_directory:
os.chdir(data_dir)
directory = None
else:
directory = data_dir.absolute()

ds = GasDataSet(
200,
code="fargo_adsg",
inifile="planetpendragon_200k.par",
directory=test_data_dir / "fargo_adsg_planet",
directory=directory,
)
assert ds.nfields == 1

Expand Down

0 comments on commit 01f23fb

Please sign in to comment.