|
2 | 2 |
|
3 | 3 | import datetime |
4 | 4 | import datetime as dt |
5 | | -import sys |
| 5 | + |
| 6 | +# import sys |
6 | 7 | from typing import ( |
7 | 8 | TYPE_CHECKING, |
8 | 9 | Any, |
@@ -1390,22 +1391,28 @@ def test_timestamp_cmp() -> None: |
1390 | 1391 | ) |
1391 | 1392 | assert (eq_arr != ne_arr).all() |
1392 | 1393 |
|
1393 | | - if sys.version_info >= (3, 11) or not MYPY: |
| 1394 | + if True: # sys.version_info >= (3, 11) or not MYPY: |
1394 | 1395 | # tests in this block fail with mypy on Python 3.10 in CI only |
1395 | 1396 | # I couldn't reproduce the failure locally so skip mypy on Python 3.10 |
1396 | 1397 | eq_arr = check( |
1397 | | - assert_type(ts == c_np_ndarray_dt64, np_ndarray_bool), np.ndarray, np.bool_ |
| 1398 | + assert_type(ts == c_np_ndarray_dt64, np_1darray[np.bool]), |
| 1399 | + np_1darray[np.bool], |
| 1400 | + np.bool_, |
1398 | 1401 | ) |
1399 | 1402 | ne_arr = check( |
1400 | | - assert_type(ts != c_np_ndarray_dt64, np_ndarray_bool), np.ndarray, np.bool_ |
| 1403 | + assert_type(ts != c_np_ndarray_dt64, np_1darray[np.bool]), |
| 1404 | + np_1darray[np.bool], |
| 1405 | + np.bool_, |
1401 | 1406 | ) |
1402 | 1407 | assert (eq_arr != ne_arr).all() |
1403 | 1408 | # TODO: the following should be 2D-arrays but it doesn't work in mypy |
1404 | 1409 | eq_arr = check( |
1405 | | - assert_type(ts == c_np_2darray_dt64, np_ndarray_bool), np_ndarray_bool |
| 1410 | + assert_type(ts == c_np_2darray_dt64, np_1darray[np.bool]), |
| 1411 | + np_1darray[np.bool], |
1406 | 1412 | ) |
1407 | 1413 | ne_arr = check( |
1408 | | - assert_type(ts != c_np_2darray_dt64, np_ndarray_bool), np_ndarray_bool |
| 1414 | + assert_type(ts != c_np_2darray_dt64, np_1darray[np.bool]), |
| 1415 | + np_1darray[np.bool], |
1409 | 1416 | ) |
1410 | 1417 | assert (eq_arr != ne_arr).all() |
1411 | 1418 |
|
|
0 commit comments