55import pandas as pd
66from pandas .api .typing import NAType
77from pandas .core .arrays .boolean import BooleanArray
8- import pytest
98from typing_extensions import assert_type
109
1110from tests import check
@@ -24,8 +23,8 @@ def test_arithmetic() -> None:
2423
2524 # __radd__
2625 check (assert_type (s_int + na , pd .Series ), pd .Series )
27- # https://github.com/pandas-dev/pandas-stubs/issues/1347
28- check (assert_type (idx_int + na , pd .Index ), pd .Index ) # type: ignore[assert-type] # pyright: ignore[reportAssertTypeFailure]
26+ # requires orthogonal fix: https://github.com/pandas-dev/pandas-stubs/issues/1347
27+ # check(assert_type(idx_int + na, pd.Index), pd.Index)
2928 check (assert_type (1 + na , NAType ), NAType )
3029
3130 # __sub__
@@ -35,8 +34,8 @@ def test_arithmetic() -> None:
3534
3635 # __rsub__
3736 check (assert_type (s_int - na , pd .Series ), pd .Series )
38- # https://github.com/pandas-dev/pandas-stubs/issues/1347
39- check (assert_type (idx_int - na , pd .Index ), pd .Index ) # type: ignore[assert-type]# pyright: ignore[reportAssertTypeFailure]
37+ # requires orthogonal fix: https://github.com/pandas-dev/pandas-stubs/issues/1347
38+ # check(assert_type(idx_int - na, pd.Index), pd.Index)
4039 check (assert_type (1 - na , NAType ), NAType )
4140
4241 # __mul__
@@ -46,8 +45,8 @@ def test_arithmetic() -> None:
4645
4746 # __rmul__
4847 check (assert_type (s_int * na , pd .Series ), pd .Series )
49- # https://github.com/pandas-dev/pandas-stubs/issues/1347
50- check (assert_type (idx_int * na , pd .Index ), pd .Index ) # type: ignore[assert-type]# pyright: ignore[reportAssertTypeFailure]
48+ # requires orthogonal fix: https://github.com/pandas-dev/pandas-stubs/issues/1347
49+ # check(assert_type(idx_int * na, pd.Index), pd.Index)
5150 check (assert_type (1 * na , NAType ), NAType )
5251
5352 # __matmul__
@@ -83,43 +82,39 @@ def test_arithmetic() -> None:
8382
8483 # __rmod__
8584 check (assert_type (s_int % na , pd .Series ), pd .Series )
86- # https://github.com/pandas-dev/pandas-stubs/issues/1347
87- check (assert_type (idx_int % na , pd .Index ), pd .Index ) # type: ignore[assert-type] # pyright: ignore[reportAssertTypeFailure]
85+ # requires orthogonal fix: https://github.com/pandas-dev/pandas-stubs/issues/1347
86+ # check(assert_type(idx_int % na, pd.Index), pd.Index)
8887 check (assert_type (1 % na , NAType ), NAType )
8988
9089 # __divmod__
91- with pytest .raises (RuntimeError ):
92- # bug upstream: https://github.com/pandas-dev/pandas/issues/62196
93- check (
94- assert_type (
95- divmod (na , s_int ), # pyright: ignore[reportAssertTypeFailure]
96- tuple [pd .Series , pd .Series ],
97- ),
98- tuple ,
99- )
100- with pytest .raises (RuntimeError ):
101- check (
102- assert_type (
103- divmod (na , idx_int ), # pyright: ignore[reportAssertTypeFailure]
104- tuple [pd .Index , pd .Index ],
105- ),
106- tuple ,
107- )
90+ # bug upstream: https://github.com/pandas-dev/pandas/issues/62196
91+ # check(
92+ # assert_type(
93+ # divmod(na, s_int),
94+ # tuple[pd.Series, pd.Series],
95+ # ),
96+ # tuple,
97+ # )
98+ # check(
99+ # assert_type(
100+ # divmod(na, idx_int),
101+ # tuple[pd.Index, pd.Index],
102+ # ),
103+ # tuple,
104+ # )
108105 check (assert_type (divmod (na , 1 ), tuple [NAType , NAType ]), tuple )
109106
110107 # __rdivmod__
111- with pytest .raises (RuntimeError ):
112- # bug upstream: https://github.com/pandas-dev/pandas/issues/62196
113- check (
114- assert_type (divmod (s_int , na ), tuple [pd .Series , pd .Series ]), # type: ignore[assert-type] # pyright: ignore[reportAssertTypeFailure]
115- tuple ,
116- )
117- with pytest .raises (RuntimeError ):
118- # https://github.com/pandas-dev/pandas-stubs/issues/1347
119- check (
120- assert_type (divmod (idx_int , na ), tuple [pd .Index , pd .Index ]), # type: ignore[assert-type] # pyright: ignore[reportAssertTypeFailure]
121- tuple ,
122- )
108+ # bug upstream: https://github.com/pandas-dev/pandas/issues/62196
109+ # check(
110+ # assert_type(divmod(s_int, na), tuple[pd.Series, pd.Series]),
111+ # tuple,
112+ # )
113+ # https://github.com/pandas-dev/pandas-stubs/issues/1347
114+ # check(
115+ # assert_type(divmod(idx_int, na), tuple[pd.Index, pd.Index]),
116+ # tuple,
117+ # )
123118 check (assert_type (divmod (1 , na ), tuple [NAType , NAType ]), tuple )
124119
125120 # __eq__
@@ -159,8 +154,8 @@ def test_arithmetic() -> None:
159154
160155 # __rpow__
161156 check (assert_type (s_int ** na , pd .Series ), pd .Series )
162- # https://github.com/pandas-dev/pandas-stubs/issues/1347
163- check (assert_type (idx_int ** na , pd .Index ), pd .Index ) # type: ignore[assert-type] # pyright: ignore[reportAssertTypeFailure]
157+ # requires orthogonal fix: https://github.com/pandas-dev/pandas-stubs/issues/1347
158+ # check(assert_type(idx_int**na, pd.Index), pd.Index)
164159 check (assert_type (2 ** na , NAType ), NAType )
165160
166161 # __and__
0 commit comments