-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Labels
enhancementNew feature or requestNew feature or request
Description
There is an issue where we have two tests that check the same thing where the only difference is which library is used. E.g.
def test_drop_variables_original():
with open_dataset(
TEST_FILES_DIR / "0000.sdf",
drop_variables=["Electric_Field/Ex", "Electric_Field/Ey"],
) as df:
assert "Electric_Field_Ex" not in df
assert "Electric_Field_Ey" not in df
def test_xr_drop_variables_original():
with xr.open_dataset(
TEST_FILES_DIR / "0000.sdf",
drop_variables=["Electric_Field/Ex", "Electric_Field/Ey"],
) as df:
assert "Electric_Field_Ex" not in df
assert "Electric_Field_Ey" not in dfTo avoid this duplication of tests that accomplish the same goal but with different signatures we should use the pytest decorator as suggested by @LiamPattinson.
@pytest.mark.parametrize("xrlib", (xr, sdfxr))
def test_drop_variables_original():
with xrlib.open_dataset(
TEST_FILES_DIR / "0000.sdf",
drop_variables=["Electric_Field/Ex", "Electric_Field/Ey"],
) as df:
assert "Electric_Field_Ex" not in df
assert "Electric_Field_Ey" not in dfReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request