Skip to content

Commit 9b45bc8

Browse files
author
maddogghoek
committed
skip invalid inclusion value if type checking is turned on
issue pydata#9886
1 parent d500e79 commit 9b45bc8

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

xarray/tests/test_cftime_offsets.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1530,8 +1530,10 @@ def test_cftime_or_date_range_invalid_inclusive_value(use_cftime: bool) -> None:
15301530
if use_cftime and not has_cftime:
15311531
pytest.skip("requires cftime")
15321532

1533-
error_type = TypeError if TYPE_CHECKING else ValueError
1534-
with pytest.raises(error_type, match="nclusive"):
1533+
if TYPE_CHECKING:
1534+
pytest.skip("inclusive type checked internally")
1535+
1536+
with pytest.raises(ValueError, match="nclusive"):
15351537
date_range("2000", periods=3, inclusive="foo", use_cftime=use_cftime)
15361538

15371539

0 commit comments

Comments
 (0)