-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
TST: make _skip_if into pytest decorators #18190
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
Comments
I could take a stab at this. What private module do you want the decorators to be in? Something like |
i wouldn’t import * them but the name is ok |
For the skipif decorators, we need to provide a function that evaluates to I would propose here to catch a Before I go too far - do you agree with this direction? I'm somewhat hesitant to use it given the
|
I would refactor like your 2nd method, IOW have a safe importer that returns a boolean, then you could actually auto-create the functions & skip decorators. |
certainly if you want a PR for a simple version would be great to see before you convert everything. key is that has to be a separate module that is only imported when tests are run and not in pandas import (so deps are not imported until then) |
EDIT - moved checklist to top of thread |
@jreback as far as the pandas/pandas/tests/sparse/test_frame.py Line 1234 in 7a0ee19
I believe that was introduced by 56b5a30 and I looked through the related comments in #15668 but am not clear on why that particular test needs the v <= 0.19.0 criteria. Any insight as to if that is needed or not? FWIW that test runs on my machine with SciPy 1.0, save the |
@WillAyd I updated the top list, but I think I missed a couple. |
I'm looking at how we should skip tests in xarray. Why did you do this rather than pytest's |
importerskip is a hammer |
Some other things to consider:
|
we should move the
_skip_if_*
functions out ofpandas.util.testing
to another (private module)then we can add skipif decorators
and use like this
rather than calling
tm._skip_if_windows_py390
in the body of the function (sometimes you also need to do that, so we leave the functions themselves as well).this makes much more idiomatic and readable pytest code and removes the need to roll your own when using the decorator.
The text was updated successfully, but these errors were encountered: