From 284c315d152034e3ba8594811222ae4a0a5bb851 Mon Sep 17 00:00:00 2001 From: Patrick Hoefler <61934744+phofl@users.noreply.github.com> Date: Sun, 18 Apr 2021 17:55:38 +0200 Subject: [PATCH 1/2] Revert "Skipt failing tests for numpy dev (#40877)" (#41015) This reverts commit 895f0b40 (cherry picked from commit 70435eba769c6bcf57332306455eb70db9fa1111) --- .../tests/arrays/boolean/test_arithmetic.py | 5 +--- pandas/tests/arrays/masked/test_arithmetic.py | 4 --- pandas/tests/extension/test_boolean.py | 30 ------------------- 3 files changed, 1 insertion(+), 38 deletions(-) diff --git a/pandas/tests/arrays/boolean/test_arithmetic.py b/pandas/tests/arrays/boolean/test_arithmetic.py index 9b854a81f2def..01de64568a011 100644 --- a/pandas/tests/arrays/boolean/test_arithmetic.py +++ b/pandas/tests/arrays/boolean/test_arithmetic.py @@ -66,10 +66,7 @@ def test_div(left_array, right_array): @pytest.mark.parametrize( "opname", [ - pytest.param( - "floordiv", - marks=pytest.mark.xfail(reason="NumpyDev GH#40874", strict=False), - ), + "floordiv", "mod", pytest.param( "pow", marks=pytest.mark.xfail(reason="TODO follow int8 behaviour? GH34686") diff --git a/pandas/tests/arrays/masked/test_arithmetic.py b/pandas/tests/arrays/masked/test_arithmetic.py index 34686f6052131..148b7092abb56 100644 --- a/pandas/tests/arrays/masked/test_arithmetic.py +++ b/pandas/tests/arrays/masked/test_arithmetic.py @@ -3,8 +3,6 @@ import numpy as np import pytest -from pandas.compat.numpy import is_numpy_dev - import pandas as pd import pandas._testing as tm from pandas.core.arrays import ExtensionArray @@ -51,8 +49,6 @@ def test_array_scalar_like_equivalence(data, all_arithmetic_operators): def test_array_NA(data, all_arithmetic_operators): if "truediv" in all_arithmetic_operators: pytest.skip("division with pd.NA raises") - if "floordiv" in all_arithmetic_operators and is_numpy_dev: - pytest.skip("NumpyDev behavior GH#40874") data, _ = data op = tm.get_op_from_name(all_arithmetic_operators) check_skip(data, all_arithmetic_operators) diff --git a/pandas/tests/extension/test_boolean.py b/pandas/tests/extension/test_boolean.py index d15c822f22c14..838906fff4b0a 100644 --- a/pandas/tests/extension/test_boolean.py +++ b/pandas/tests/extension/test_boolean.py @@ -16,8 +16,6 @@ import numpy as np import pytest -from pandas.compat.numpy import is_numpy_dev - import pandas as pd import pandas._testing as tm from pandas.core.arrays.boolean import BooleanDtype @@ -141,38 +139,10 @@ def _check_op(self, s, op, other, op_name, exc=NotImplementedError): with pytest.raises(exc): op(s, other) - def test_arith_series_with_scalar(self, data, all_arithmetic_operators): - if "floordiv" in all_arithmetic_operators and is_numpy_dev: - pytest.skip("NumpyDev behavior GH#40874") - super().test_arith_series_with_scalar(data, all_arithmetic_operators) - - def test_arith_series_with_array(self, data, all_arithmetic_operators): - if "floordiv" in all_arithmetic_operators and is_numpy_dev: - pytest.skip("NumpyDev behavior GH#40874") - super().test_arith_series_with_scalar(data, all_arithmetic_operators) - - def test_divmod_series_array(self, data, data_for_twos): - if is_numpy_dev: - pytest.skip("NumpyDev behavior GH#40874") - super().test_divmod_series_array(data, data_for_twos) - def _check_divmod_op(self, s, op, other, exc=None): # override to not raise an error super()._check_divmod_op(s, op, other, None) - @pytest.mark.skip(reason="BooleanArray does not error on ops") - def test_error(self, data, all_arithmetic_operators): - # other specific errors tested in the boolean array specific tests - pass - - def test_arith_frame_with_scalar(self, data, all_arithmetic_operators, request): - # frame & scalar - op_name = all_arithmetic_operators - if op_name not in self.implements: - mark = pytest.mark.xfail(reason="_reduce needs implementation") - request.node.add_marker(mark) - super().test_arith_frame_with_scalar(data, all_arithmetic_operators) - class TestComparisonOps(base.BaseComparisonOpsTests): def check_opname(self, s, op_name, other, exc=None): From e24786a5da9765ec26628fcefeeb6f4b4d9baf38 Mon Sep 17 00:00:00 2001 From: phofl Date: Sun, 18 Apr 2021 18:33:34 +0200 Subject: [PATCH 2/2] Add accidentially deleted code back in --- pandas/tests/extension/test_boolean.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pandas/tests/extension/test_boolean.py b/pandas/tests/extension/test_boolean.py index 838906fff4b0a..86a0bc9213256 100644 --- a/pandas/tests/extension/test_boolean.py +++ b/pandas/tests/extension/test_boolean.py @@ -143,6 +143,19 @@ def _check_divmod_op(self, s, op, other, exc=None): # override to not raise an error super()._check_divmod_op(s, op, other, None) + @pytest.mark.skip(reason="BooleanArray does not error on ops") + def test_error(self, data, all_arithmetic_operators): + # other specific errors tested in the boolean array specific tests + pass + + def test_arith_frame_with_scalar(self, data, all_arithmetic_operators, request): + # frame & scalar + op_name = all_arithmetic_operators + if op_name not in self.implements: + mark = pytest.mark.xfail(reason="_reduce needs implementation") + request.node.add_marker(mark) + super().test_arith_frame_with_scalar(data, all_arithmetic_operators) + class TestComparisonOps(base.BaseComparisonOpsTests): def check_opname(self, s, op_name, other, exc=None):