Skip to content

Commit

Permalink
TST: xfail test due to new numexpr version (pandas-dev#55300)
Browse files Browse the repository at this point in the history
  • Loading branch information
mroeschke authored Sep 26, 2023
1 parent 98f5a78 commit 61d2056
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions pandas/tests/frame/test_arithmetic.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,12 @@
)
import pandas._testing as tm
from pandas.core.computation import expressions as expr
from pandas.core.computation.expressions import (
_MIN_ELEMENTS,
NUMEXPR_INSTALLED,
)
from pandas.core.computation.expressions import _MIN_ELEMENTS
from pandas.tests.frame.common import (
_check_mixed_float,
_check_mixed_int,
)
from pandas.util.version import Version


@pytest.fixture(autouse=True, params=[0, 1000000], ids=["numexpr", "python"])
Expand Down Expand Up @@ -501,10 +499,19 @@ def test_floordiv_axis0(self):
result2 = df.floordiv(ser.values, axis=0)
tm.assert_frame_equal(result2, expected)

@pytest.mark.skipif(not NUMEXPR_INSTALLED, reason="numexpr not installed")
@pytest.mark.parametrize("opname", ["floordiv", "pow"])
def test_floordiv_axis0_numexpr_path(self, opname):
def test_floordiv_axis0_numexpr_path(self, opname, request):
# case that goes through numexpr and has to fall back to masked_arith_op
ne = pytest.importorskip("numexpr")
if (
Version(ne.__version__) >= Version("2.8.7")
and opname == "pow"
and "python" in request.node.callspec.id
):
request.node.add_marker(
pytest.mark.xfail(reason="https://github.com/pydata/numexpr/issues/454")
)

op = getattr(operator, opname)

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

0 comments on commit 61d2056

Please sign in to comment.