Skip to content

Commit

Permalink
one more cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
dcherian committed Apr 25, 2024
1 parent 0fe1e1c commit 14c8379
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions xarray/tests/test_variable.py
Original file line number Diff line number Diff line change
Expand Up @@ -3010,7 +3010,7 @@ def test_pandas_two_only_datetime_conversion_warnings() -> None:


@pytest.mark.parametrize(
("values", "warns_under_pandas_version_two"),
("values", "warns"),
[
(np.timedelta64(10, "ns"), False),
(np.timedelta64(10, "s"), True),
Expand All @@ -3022,9 +3022,9 @@ def test_pandas_two_only_datetime_conversion_warnings() -> None:
],
ids=lambda x: f"{x}",
)
def test_timedelta_conversion_warning(values, warns_under_pandas_version_two) -> None:
def test_timedelta_conversion_warning(values, warns) -> None:
dims = ["time"] if isinstance(values, (np.ndarray, pd.Index)) else []
if warns_under_pandas_version_two:
if warns:
with pytest.warns(UserWarning, match="non-nanosecond precision timedelta"):
var = Variable(dims, values)
else:
Expand Down

0 comments on commit 14c8379

Please sign in to comment.