Skip to content

Commit

Permalink
replace lazy_fixture
Browse files Browse the repository at this point in the history
  • Loading branch information
observingClouds committed Feb 6, 2024
1 parent 897345b commit 5e698f2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
17 changes: 9 additions & 8 deletions tests/test_bitinformation_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,18 @@
@pytest.mark.parametrize(
"ds,dim,axis",
[
(pytest.lazy_fixture("ugrid_demo"), None, -1),
(pytest.lazy_fixture("icon_grid_demo"), "ncells", None),
(pytest.lazy_fixture("air_temperature"), "lon", None),
(pytest.lazy_fixture("rasm"), "x", None),
(pytest.lazy_fixture("ROMS_example"), "eta_rho", None),
(pytest.lazy_fixture("era52mt"), "time", None),
(pytest.lazy_fixture("eraint_uvz"), "longitude", None),
("ugrid_demo", None, -1),
("icon_grid_demo", "ncells", None),
("air_temperature", "lon", None),
("rasm", "x", None),
("ROMS_example", "eta_rho", None),
("era52mt", "time", None),
("eraint_uvz", "longitude", None),
],
)
def test_full(ds, dim, axis):
def test_full(ds, dim, axis, request):
"""Test xbitinfo end to end."""
ds = request.getfixturevalue(ds)
# xbitinfo
bitinfo = xb.get_bitinformation(ds, dim=dim, axis=axis)
keepbits = xb.get_keepbits(bitinfo)
Expand Down
17 changes: 9 additions & 8 deletions tests/test_get_bitinformation.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,17 +226,18 @@ def test_get_bitinformation_keep_attrs(rasm):
@pytest.mark.parametrize(
"ds,dim,axis",
[
(pytest.lazy_fixture("ugrid_demo"), None, -1),
(pytest.lazy_fixture("icon_grid_demo"), "ncells", None),
(pytest.lazy_fixture("air_temperature"), "lon", None),
(pytest.lazy_fixture("rasm"), "x", None),
(pytest.lazy_fixture("ROMS_example"), "eta_rho", None),
(pytest.lazy_fixture("era52mt"), "time", None),
(pytest.lazy_fixture("eraint_uvz"), "longitude", None),
("ugrid_demo", None, -1),
("icon_grid_demo", "ncells", None),
("air_temperature", "lon", None),
("rasm", "x", None),
("ROMS_example", "eta_rho", None),
("era52mt", "time", None),
("eraint_uvz", "longitude", None),
],
)
def test_implementations_agree(ds, dim, axis):
def test_implementations_agree(ds, dim, axis, request):
"""Test whether the python and julia implementation retrieve the same results"""
ds = request.getfixturevalue(ds)
bi_python = xb.get_bitinformation(
ds,
dim=dim,
Expand Down

0 comments on commit 5e698f2

Please sign in to comment.