Skip to content

Commit fd76235

Browse files
Backport PR #55300 on branch 2.1.x (TST: xfail test due to new numexpr version) (#55303)
Backport PR #55300: TST: xfail test due to new numexpr version Co-authored-by: Matthew Roeschke <[email protected]>
1 parent eec2023 commit fd76235

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

pandas/tests/frame/test_arithmetic.py

+13-6
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,12 @@
2222
)
2323
import pandas._testing as tm
2424
from pandas.core.computation import expressions as expr
25-
from pandas.core.computation.expressions import (
26-
_MIN_ELEMENTS,
27-
NUMEXPR_INSTALLED,
28-
)
25+
from pandas.core.computation.expressions import _MIN_ELEMENTS
2926
from pandas.tests.frame.common import (
3027
_check_mixed_float,
3128
_check_mixed_int,
3229
)
30+
from pandas.util.version import Version
3331

3432

3533
@pytest.fixture(autouse=True, params=[0, 1000000], ids=["numexpr", "python"])
@@ -502,10 +500,19 @@ def test_floordiv_axis0(self):
502500
result2 = df.floordiv(ser.values, axis=0)
503501
tm.assert_frame_equal(result2, expected)
504502

505-
@pytest.mark.skipif(not NUMEXPR_INSTALLED, reason="numexpr not installed")
506503
@pytest.mark.parametrize("opname", ["floordiv", "pow"])
507-
def test_floordiv_axis0_numexpr_path(self, opname):
504+
def test_floordiv_axis0_numexpr_path(self, opname, request):
508505
# case that goes through numexpr and has to fall back to masked_arith_op
506+
ne = pytest.importorskip("numexpr")
507+
if (
508+
Version(ne.__version__) >= Version("2.8.7")
509+
and opname == "pow"
510+
and "python" in request.node.callspec.id
511+
):
512+
request.node.add_marker(
513+
pytest.mark.xfail(reason="https://github.com/pydata/numexpr/issues/454")
514+
)
515+
509516
op = getattr(operator, opname)
510517

511518
arr = np.arange(_MIN_ELEMENTS + 100).reshape(_MIN_ELEMENTS // 100 + 1, -1) * 100

0 commit comments

Comments
 (0)