Skip to content

Commit 39c9fff

Browse files
committed
Skip mypy failing tests on Python 3.10
1 parent c31b35c commit 39c9fff

File tree

1 file changed

+19
-15
lines changed

1 file changed

+19
-15
lines changed

tests/test_scalars.py

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import datetime
44
import datetime as dt
5+
import sys
56
from typing import (
67
TYPE_CHECKING,
78
Any,
@@ -51,6 +52,8 @@
5152
PeriodSeries: TypeAlias = pd.Series
5253
OffsetSeries: TypeAlias = pd.Series
5354

55+
MYPY = False
56+
5457

5558
def test_interval() -> None:
5659
interval_i = pd.Interval(0, 1, closed="left")
@@ -1387,21 +1390,22 @@ def test_timestamp_cmp() -> None:
13871390
)
13881391
assert (eq_arr != ne_arr).all()
13891392

1390-
eq_arr = check(
1391-
assert_type(ts == c_np_ndarray_dt64, np_ndarray_bool), np.ndarray, np.bool_
1392-
)
1393-
ne_arr = check(
1394-
assert_type(ts != c_np_ndarray_dt64, np_ndarray_bool), np.ndarray, np.bool_
1395-
)
1396-
assert (eq_arr != ne_arr).all()
1397-
# TODO: the following should be 2D-arrays but it doesn't work in mypy
1398-
eq_arr = check(
1399-
assert_type(ts == c_np_2darray_dt64, np_ndarray_bool), np_ndarray_bool
1400-
)
1401-
ne_arr = check(
1402-
assert_type(ts != c_np_2darray_dt64, np_ndarray_bool), np_ndarray_bool
1403-
)
1404-
assert (eq_arr != ne_arr).all()
1393+
if sys.version_info >= (3, 11) or not MYPY:
1394+
eq_arr = check(
1395+
assert_type(ts == c_np_ndarray_dt64, np_ndarray_bool), np.ndarray, np.bool_
1396+
)
1397+
ne_arr = check(
1398+
assert_type(ts != c_np_ndarray_dt64, np_ndarray_bool), np.ndarray, np.bool_
1399+
)
1400+
assert (eq_arr != ne_arr).all()
1401+
# TODO: the following should be 2D-arrays but it doesn't work in mypy
1402+
eq_arr = check(
1403+
assert_type(ts == c_np_2darray_dt64, np_ndarray_bool), np_ndarray_bool
1404+
)
1405+
ne_arr = check(
1406+
assert_type(ts != c_np_2darray_dt64, np_ndarray_bool), np_ndarray_bool
1407+
)
1408+
assert (eq_arr != ne_arr).all()
14051409

14061410
eq_s = check(
14071411
assert_type(ts == c_series_timestamp, "pd.Series[bool]"), pd.Series, np.bool_

0 commit comments

Comments
 (0)