Skip to content

Commit

Permalink
Backport PR #55300 on branch 2.1.x (TST: xfail test due to new numexp…
Browse files Browse the repository at this point in the history
…r version) (#55303)

Backport PR #55300: TST: xfail test due to new numexpr version

Co-authored-by: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com>
  • Loading branch information
meeseeksmachine and mroeschke committed Sep 26, 2023
1 parent eec2023 commit fd76235
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 @@ -502,10 +500,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 fd76235

Please sign in to comment.