Skip to content

Converted windows / 32bit skips into decorators #18693

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 4 commits into from
Dec 11, 2017

Conversation

WillAyd
Copy link
Member

@WillAyd WillAyd commented Dec 8, 2017

Don't have a 32bit or Windows platform at my disposal so plan to leverage AppVeyor and compare before / after of skips to ensure consistency. If you have other ideas on how to tackle let me know.

FWIW the functions that were previously defined in pandas.util.testing were scarcely used, but I noticed that a lot of tests manually checked for 32 bit or windows and skipped directly. For consistency, I've updated those to use the decorators as well (will need to go back and do the same thing for matplotlib)

@codecov
Copy link

codecov bot commented Dec 8, 2017

Codecov Report

Merging #18693 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #18693      +/-   ##
==========================================
+ Coverage    91.6%    91.6%   +<.01%     
==========================================
  Files         153      153              
  Lines       51272    51261      -11     
==========================================
- Hits        46967    46957      -10     
+ Misses       4305     4304       -1
Flag Coverage Δ
#multiple 89.46% <100%> (+0.01%) ⬆️
#single 40.69% <100%> (-0.1%) ⬇️
Impacted Files Coverage Δ
pandas/util/testing.py 82.53% <ø> (+0.7%) ⬆️
pandas/util/_test_decorators.py 94.11% <100%> (+0.78%) ⬆️
pandas/io/gbq.py 25% <0%> (-58.34%) ⬇️
pandas/core/frame.py 97.81% <0%> (-0.1%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 288bf6e...86fd4d6. Read the comment docs.

@codecov
Copy link

codecov bot commented Dec 8, 2017

Codecov Report

Merging #18693 into master will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #18693      +/-   ##
==========================================
+ Coverage   91.58%    91.6%   +0.01%     
==========================================
  Files         153      153              
  Lines       51307    51262      -45     
==========================================
- Hits        46991    46958      -33     
+ Misses       4316     4304      -12
Flag Coverage Δ
#multiple 89.46% <100%> (+0.03%) ⬆️
#single 40.69% <100%> (-0.14%) ⬇️
Impacted Files Coverage Δ
pandas/util/testing.py 82.53% <ø> (+0.51%) ⬆️
pandas/util/_test_decorators.py 94.11% <100%> (+0.78%) ⬆️
pandas/io/gbq.py 25% <0%> (-58.34%) ⬇️
pandas/io/json/table_schema.py 95.83% <0%> (-1.39%) ⬇️
pandas/io/json/json.py 91.75% <0%> (-0.34%) ⬇️
pandas/core/frame.py 97.81% <0%> (-0.1%) ⬇️
pandas/plotting/_core.py 82.37% <0%> (-0.04%) ⬇️
pandas/io/pytables.py 92.84% <0%> (-0.01%) ⬇️
pandas/core/indexes/datetimes.py 95.68% <0%> (ø) ⬆️
pandas/core/generic.py 95.9% <0%> (ø) ⬆️
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2db1cc0...89458f5. Read the comment docs.

@WillAyd
Copy link
Member Author

WillAyd commented Dec 8, 2017

Made a mistake on my last commit applying the class decorator in test_coercion - I realized now that those conditions were only applied to certain dtypes.

Going to parameterize that class to make it more readable and integrate better with the decorator. Stay tuned...

@WillAyd
Copy link
Member Author

WillAyd commented Dec 8, 2017

As mentioned before I refactored the TestReplaceSeriesCoercion class in test_coercion to use pytest.mark.parametrize. Although I couldn't use the skip decorators in that fashion, it is still should be an improvement in readability over what was there before.

If my math is right, then comparing to upstream/master this should:

Python 3 Windows

  • Add 154 passing tests
    • test_coercion
      • -1 for removing test_has_comprehensive_tests
      • +144 for to_key from_key and how parameters in test_replace_series EXCEPT
      • +9 when from_key is bool, because the series tests get skipped
      • +2 for test_frame and test_store_mixed being parametrized in test_pytables
  • Skip 22 more tests
    • test_coercion
      • +5 parametrization now has 6 total tests to skip for down casting, instead of just one before
      • +8 more skips for parametrization of from_key of bool and how of series
      • +8 when from_key is bool, because the series tests get skipped

Python 2 Windows

  • The -9 skips when from_key is bool, because the series move into passing tests
  • +2 skips for test_frame and test_store_mixed being parametrized test_pytables

@jreback jreback added Testing pandas testing functions or related to the test suite Windows Windows OS labels Dec 9, 2017
@jreback
Copy link
Contributor

jreback commented Dec 9, 2017

Some linting, you can use make lint-diff locally

$ ci/lint.sh
inside ci/lint.sh
Linting *.py
pandas/tests/io/test_pytables.py:27:1: F401 'pandas.compat.PY3' imported but unused
pandas/tests/util/test_testing.py:13:1: F401 'pandas.compat.is_platform_windows' imported but unused
Linting *.py DONE

@jreback
Copy link
Contributor

jreback commented Dec 9, 2017

a test failure on windows 3.6: https://ci.appveyor.com/project/pandas-dev/pandas/build/1.0.7841/job/2it8g3yxrmgg9mdl

I believe this was skipped before (on windows / python 3). its a float64 conversion to complex128.

@jreback
Copy link
Contributor

jreback commented Dec 9, 2017

otherwise changes lgtm. ping on green.

@WillAyd
Copy link
Member Author

WillAyd commented Dec 9, 2017

Yep thanks for the callout. I also have to make some changes to test_coercion because using the td.skip_if functions in an imperative manner does not actually skip the tests. I'm exploring some Pytest options right now but may end up backing out changes to that module and leaving that to a separate change to be parametrized, assuming that there's no way obvious way to decorate the combinations of dtypes that are currently being skipped

@WillAyd
Copy link
Member Author

WillAyd commented Dec 9, 2017

I ended up checking out test_coercion.py from upstream/master because I couldn't figure out a great way to refactor it using the skip_if decorators. The classes there can still be parametrized, but I opened up #18706 to cover that rather than doing it here, since that would assumedly be done without decorators

With this last push, I'd expect 2 more passing tests in Python 2 and 2 more skipped tests in Python 3 due to the parametrization of test_frame and test_store_mixed in test_pytables.py

@jreback
Copy link
Contributor

jreback commented Dec 9, 2017

ok lgtm ping on green

thanks for making that issue
nice to have parameter ization there

@WillAyd
Copy link
Member Author

WillAyd commented Dec 10, 2017

@jreback is there any option to increase the verbosity on the AppVeyor test runs? The number of tests being executed is still slightly off of my expectation. I have the feeling that two tests have somehow been lost

@jreback
Copy link
Contributor

jreback commented Dec 10, 2017

sure in your PR add -v to the pytest line in appveyor.yml
can revert the commit before merging

@jreback
Copy link
Contributor

jreback commented Dec 10, 2017

also i believe u can login to appveyor under your own account and you’re builds will run there as well (and so will be faster)

@jreback
Copy link
Contributor

jreback commented Dec 10, 2017

can you rebase and push again

@WillAyd
Copy link
Member Author

WillAyd commented Dec 10, 2017

Just rebased and re-pushed. FWIW I checked a verbose log in AppVeyor and all of the tests changed matched my expectation and were skipped accordingly. I still am not getting 100% the numbers I was expecting but I don't think any differences there are a result of this change

@jreback jreback added this to the 0.22.0 milestone Dec 11, 2017
@jreback jreback merged commit ae74c2b into pandas-dev:master Dec 11, 2017
@jreback
Copy link
Contributor

jreback commented Dec 11, 2017

nice! keep em coming!

@jreback
Copy link
Contributor

jreback commented Dec 11, 2017

I took off the closing of #18190, we can just make checkboxes I think. can you prepare a list (and I'll update the top of the issue).

@WillAyd WillAyd deleted the platform-skipifs branch December 11, 2017 01:21
@WillAyd
Copy link
Member Author

WillAyd commented Dec 11, 2017

You should be able to copy the checklist that's in my comment at the bottom of #18190. I just updated it to reflect the change here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Testing pandas testing functions or related to the test suite Windows Windows OS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants