Skip to content

Commit 7b1803c

Browse files
authored
Backport PR #40877 on branch 1.2.x (Skipt failing tests for numpy dev) (#40882)
1 parent 3fae915 commit 7b1803c

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
lines changed

pandas/tests/arrays/boolean/test_arithmetic.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,10 @@ def test_div(left_array, right_array):
6666
@pytest.mark.parametrize(
6767
"opname",
6868
[
69-
"floordiv",
69+
pytest.param(
70+
"floordiv",
71+
marks=pytest.mark.xfail(reason="NumpyDev GH#40874", strict=False),
72+
),
7073
"mod",
7174
pytest.param(
7275
"pow", marks=pytest.mark.xfail(reason="TODO follow int8 behaviour? GH34686")

pandas/tests/arrays/masked/test_arithmetic.py

+4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
import numpy as np
44
import pytest
55

6+
from pandas.compat.numpy import is_numpy_dev
7+
68
import pandas as pd
79
import pandas._testing as tm
810
from pandas.core.arrays import ExtensionArray
@@ -49,6 +51,8 @@ def test_array_scalar_like_equivalence(data, all_arithmetic_operators):
4951
def test_array_NA(data, all_arithmetic_operators):
5052
if "truediv" in all_arithmetic_operators:
5153
pytest.skip("division with pd.NA raises")
54+
if "floordiv" in all_arithmetic_operators and is_numpy_dev:
55+
pytest.skip("NumpyDev behavior GH#40874")
5256
data, _ = data
5357
op = tm.get_op_from_name(all_arithmetic_operators)
5458
check_skip(data, all_arithmetic_operators)

pandas/tests/extension/test_boolean.py

+17
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
import numpy as np
1717
import pytest
1818

19+
from pandas.compat.numpy import is_numpy_dev
20+
1921
import pandas as pd
2022
import pandas._testing as tm
2123
from pandas.core.arrays.boolean import BooleanDtype
@@ -139,6 +141,21 @@ def _check_op(self, s, op, other, op_name, exc=NotImplementedError):
139141
with pytest.raises(exc):
140142
op(s, other)
141143

144+
def test_arith_series_with_scalar(self, data, all_arithmetic_operators):
145+
if "floordiv" in all_arithmetic_operators and is_numpy_dev:
146+
pytest.skip("NumpyDev behavior GH#40874")
147+
super().test_arith_series_with_scalar(data, all_arithmetic_operators)
148+
149+
def test_arith_series_with_array(self, data, all_arithmetic_operators):
150+
if "floordiv" in all_arithmetic_operators and is_numpy_dev:
151+
pytest.skip("NumpyDev behavior GH#40874")
152+
super().test_arith_series_with_scalar(data, all_arithmetic_operators)
153+
154+
def test_divmod_series_array(self, data, data_for_twos):
155+
if is_numpy_dev:
156+
pytest.skip("NumpyDev behavior GH#40874")
157+
super().test_divmod_series_array(data, data_for_twos)
158+
142159
def _check_divmod_op(self, s, op, other, exc=None):
143160
# override to not raise an error
144161
super()._check_divmod_op(s, op, other, None)

0 commit comments

Comments
 (0)