Skip to content

Use pandas wrapper functions for the test suite #1021

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 7 commits into from
Aug 7, 2020

Conversation

kandersolar
Copy link
Member

@kandersolar kandersolar commented Aug 7, 2020

Seeing what Azure thinks of the changes.

Possible to-do items:

  • Add tests for the new assert functions somehow?
  • Whatsnew?

@kandersolar
Copy link
Member Author

Tests pass. Codecov is low because it's only getting results from one branch of the if parse_version(pd.__version__) >= parse_version('1.1.0') switch, so it sees the other as uncovered.

@cwhanse cwhanse added the testing label Aug 7, 2020
@cwhanse cwhanse added this to the 0.8.0 milestone Aug 7, 2020
Copy link
Member

@wholmgren wholmgren left a comment

Choose a reason for hiding this comment

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

+1 for a what's new entry. It might be worth testing the _check_pandas_assert_kwargs function with a mocked pd.__version__.

@kandersolar
Copy link
Member Author

A mocked version test is interesting but I'm not sure how it would work. Mock the other version and test that it raises a TypeError for the unexpected keyword argument?

@wholmgren
Copy link
Member

I'd patch and set the appropriate return_value for both conditions regardless of the true pandas version. The test would assert that the correct kwargs are included/excluded from the function.

@kandersolar
Copy link
Member Author

Thanks, that got me on the right track. I've added a test, but wouldn't be surprised if it could be made simpler.

@wholmgren wholmgren merged commit 9f56660 into pvlib:master Aug 7, 2020
@wholmgren
Copy link
Member

thanks @kanderso-nrel!

@kandersolar kandersolar deleted the pandas_test_tolerance branch August 8, 2020 02:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pandas.testing.assert_series_equal precision defaults changed in pandas 1.1.0
3 participants