Skip to content

CLN: Clean test_arithmetic.py #36390

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
Sep 15, 2020
Merged

CLN: Clean test_arithmetic.py #36390

merged 3 commits into from
Sep 15, 2020

Conversation

dsaxton
Copy link
Member

@dsaxton dsaxton commented Sep 15, 2020

General cleaning (i.e., replacing for loops) trying to make these easier to follow / debug

@dsaxton dsaxton added Clean Testing pandas testing functions or related to the test suite labels Sep 15, 2020
@@ -553,68 +551,83 @@ def test_comparison_tuples(self):
expected = Series([True, False])
tm.assert_series_equal(result, expected)

def test_comparison_operators_with_nas(self):
@pytest.mark.parametrize("op", ["lt", "le", "gt", "ge", "eq", "ne"])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these exist as dunder strings in the all_compare_operators fixture

@jreback jreback added this to the 1.2 milestone Sep 15, 2020
Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @dsaxton some comments, but happy to do in a followon.

@@ -271,7 +271,6 @@ def test_comparison_flex_basic(self):
tm.assert_series_equal(left.gt(right), left > right)
tm.assert_series_equal(left.ge(right), left >= right)

# axis
for axis in [0, None, "index"]:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could parameterize here (might have to split the test)

@@ -280,7 +279,6 @@ def test_comparison_flex_basic(self):
tm.assert_series_equal(left.gt(right, axis=axis), left > right)
tm.assert_series_equal(left.ge(right, axis=axis), left >= right)

#
msg = "No axis named 1 for object type"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could use the fixture

@jreback jreback merged commit 0d4a1c1 into pandas-dev:master Sep 15, 2020
@dsaxton dsaxton deleted the parametrize-tests branch September 15, 2020 23:25
rhshadrach pushed a commit to rhshadrach/pandas that referenced this pull request Sep 17, 2020
kesmit13 pushed a commit to kesmit13/pandas that referenced this pull request Nov 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Clean Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants