-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
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
Conversation
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
There was a problem hiding this 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.
pandas/util/_test_decorators.py
Outdated
@@ -94,6 +94,15 @@ def _skip_if_not_us_locale(): | |||
return True | |||
|
|||
|
|||
def skip_if_no(package, min_version=None): | |||
def decorated_func(func): |
There was a problem hiding this comment.
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
b0c5072
to
53d5737
Compare
@jreback one failure on travis but it doesn't look related. Everything else green |
thanks! |
git diff upstream/master -u -- "*.py" | flake8 --diff
This push should knock out the
pathlib
andlocalpath
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 theskip_if
decorator that callssafe_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