Skip to content

TST: Skip if Decorators for Localpath and Pathlib #18765

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
Dec 15, 2017

Conversation

WillAyd
Copy link
Member

@WillAyd WillAyd commented Dec 13, 2017

This push should knock out the pathlib and localpath skip if functions. Rather than creating them as their own marks, I've created a generic decorator that accepts a package and optionally a min_version as its arguments. With that, it returns a function marked with the skip_if decorator that calls safe_import to validate whether or not the function should be skipped.

This isn't applicable to all of the skip_if decorators because some of them have post-processing they do after import (see the matplotlib decorators) but for very generic import checks this could scale better in the future

@codecov
Copy link

codecov bot commented Dec 13, 2017

Codecov Report

Merging #18765 into master will decrease coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #18765      +/-   ##
==========================================
- Coverage   91.62%   91.61%   -0.02%     
==========================================
  Files         154      153       -1     
  Lines       51427    51359      -68     
==========================================
- Hits        47122    47052      -70     
- Misses       4305     4307       +2
Flag Coverage Δ
#multiple 89.47% <100%> (-0.01%) ⬇️
#single 40.76% <100%> (-0.17%) ⬇️
Impacted Files Coverage Δ
pandas/util/testing.py 82.91% <ø> (+0.38%) ⬆️
pandas/util/_test_decorators.py 93.87% <100%> (+0.54%) ⬆️
pandas/io/gbq.py 25% <0%> (-58.34%) ⬇️
pandas/core/sparse/frame.py 94.78% <0%> (-0.03%) ⬇️
pandas/core/apply.py
pandas/core/frame.py 97.81% <0%> (+0.02%) ⬆️

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 5b9b4a8...53d5737. Read the comment docs.

@jreback jreback added the Testing pandas testing functions or related to the test suite label Dec 14, 2017
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.

minor comment. ping on green.

@@ -94,6 +94,15 @@ def _skip_if_not_us_locale():
return True


def skip_if_no(package, min_version=None):
def decorated_func(func):
Copy link
Contributor

Choose a reason for hiding this comment

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

can you add a doc-string here

@jreback jreback added this to the 0.22.0 milestone Dec 14, 2017
@WillAyd
Copy link
Member Author

WillAyd commented Dec 14, 2017

@jreback one failure on travis but it doesn't look related. Everything else green

@jreback jreback merged commit 6c02c9e into pandas-dev:master Dec 15, 2017
@jreback
Copy link
Contributor

jreback commented Dec 15, 2017

thanks!

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants