Skip to content

Commit 61d2056

Browse files
authored
TST: xfail test due to new numexpr version (#55300)
1 parent 98f5a78 commit 61d2056

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

pandas/tests/frame/test_arithmetic.py

Lines changed: 13 additions & 6 deletions
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"])
@@ -501,10 +499,19 @@ def test_floordiv_axis0(self):
501499
result2 = df.floordiv(ser.values, axis=0)
502500
tm.assert_frame_equal(result2, expected)
503501

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

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

0 commit comments

Comments
 (0)