Skip to content
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

More Json parametrize #33148

Merged
merged 3 commits into from
Mar 30, 2020
Merged

Conversation

WillAyd
Copy link
Member

@WillAyd WillAyd commented Mar 30, 2020

follow on to #31191 - still a few more passes to go

@@ -521,6 +521,11 @@ def index_or_series_obj(request):
# ----------------------------------------------------------------
# DataFrames
# ----------------------------------------------------------------
@pytest.fixture
def empty_frame():
Copy link
Member Author

Choose a reason for hiding this comment

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

This is scattered across a few modules right now that I didn't touch here; can use further here or in a follow up

Copy link
Contributor

Choose a reason for hiding this comment

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

followup is fine.

def test_frame_default_orient(self):
assert self.frame.to_json() == self.frame.to_json(orient="columns")
def test_frame_default_orient(self, float_frame):
assert float_frame.to_json() == float_frame.to_json(orient="columns")
Copy link
Member Author

Choose a reason for hiding this comment

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

Note that float_frame and self.frame aren't 100% equivalent because the former has the columns labeled ABCD whereas the latter didn't provide labels. I don't think that distinction matters for these tests though

with tm.ensure_clean("test.json") as path:
for df in [
self.frame,
self.frame2,
float_frame,
Copy link
Member Author

Choose a reason for hiding this comment

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

Similar to above comment, self.frame and self.frame2 are actually different in that the former uses default column labels whereas the latter used ABCD; I didn't think that distinction was worth creating a separate fixture or object within this test

Copy link
Contributor

Choose a reason for hiding this comment

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

sure, but this is a historical accident, having a smaller set of common fixtures is better

@jbrockmendel
Copy link
Member

LGTM

@jreback jreback added IO JSON read_json, to_json, json_normalize Testing pandas testing functions or related to the test suite labels Mar 30, 2020
@jreback jreback added this to the 1.1 milestone Mar 30, 2020
@jreback jreback merged commit 32d8754 into pandas-dev:master Mar 30, 2020
@WillAyd WillAyd deleted the json-parametrize-more branch March 30, 2020 21:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IO JSON read_json, to_json, json_normalize 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