-
-
Notifications
You must be signed in to change notification settings - Fork 18.3k
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
TST: add test for df comparing strings to numbers raises ValueError #29535
TST: add test for df comparing strings to numbers raises ValueError #29535
Conversation
pandas/tests/frame/test_operators.py
Outdated
{x: {"x": "foo", "y": "bar", "z": "baz"} for x in ["a", "b", "c"]} | ||
) | ||
with pytest.raises(TypeError): | ||
df > 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you pytest.mark.parameterize
over all the operators? I think we have a fixture.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @mroeschke - now using parameterize to go over ["lt", "le", "gt", "ge", "eq", "ne"]
.
pandas/tests/frame/test_operators.py
Outdated
@@ -530,6 +530,34 @@ def test_comp(func): | |||
test_comp(operator.ge) | |||
test_comp(operator.le) | |||
|
|||
@pytest.mark.parametrize("op", ["lt", "le", "gt", "ge", "eq", "ne"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you use the compare_operators_no_eq_ne
pytest fixture instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @mroeschke - that was neat! Now using compare_operators_no_eq_ne
.
thanks @ganevgv |
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff