Skip to content

TST: Fail if parameterize set is empty #48924

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions pandas/tests/computation/test_eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,6 @@ def parser(request):
return request.param


@pytest.fixture(params=list(_unary_math_ops) if NUMEXPR_INSTALLED else [])
def unary_fns_for_ne(request):
return request.param


def _eval_single_bin(lhs, cmp1, rhs, engine):
c = _binary_ops_dict[cmp1]
if ENGINES[engine].has_neg_frac:
Expand Down Expand Up @@ -1579,12 +1574,14 @@ def eval(self, *args, **kwargs):
kwargs["level"] = kwargs.pop("level", 0) + 1
return pd.eval(*args, **kwargs)

def test_unary_functions(self, unary_fns_for_ne):
@pytest.mark.skipif(
not NUMEXPR_INSTALLED, reason="Unary ops only implemented for numexpr"
)
@pytest.mark.parametrize("fn", _unary_math_ops)
def test_unary_functions(self, fn):
df = DataFrame({"a": np.random.randn(10)})
a = df.a

fn = unary_fns_for_ne

expr = f"{fn}(a)"
got = self.eval(expr)
with np.errstate(all="ignore"):
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ disable = [
# sync minversion with pyproject.toml & install.rst
minversion = "6.0"
addopts = "--strict-data-files --strict-markers --strict-config --capture=no --durations=30 --junitxml=test-data.xml"
empty_parameter_set_mark = "fail_at_collect"
xfail_strict = true
testpaths = "pandas"
doctest_optionflags = [
Expand Down