-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
MAINT testing.nose -> testing._nose to make it explicitely private #7947
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
def __init__(self): | ||
if not has_nose: | ||
raise ImportError("Need nose for this plugin.") | ||
pass |
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.
remove the "pass"? (or at least indent it more)
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.
@NelleV I will merge the PR if you fix this :)
@@ -8,6 +8,8 @@ | |||
import matplotlib | |||
from matplotlib.cbook import is_string_like, iterable | |||
from matplotlib import rcParams, rcdefaults, use | |||
# For backward compatibility | |||
from . import noseclasses |
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.
This line would always raise a deprecationwarning, I guess, and is not needed for backcompat anyways as noseclasses was not directly imported anyways?
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.
It is needed for backward compatibility unless it wasn't there before (I actually did not check this, so it might be worth doing).
As far as I know, there is no choice other than raising a deprecation at import time for whole module deprecation.
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.
It wasn't there in 2.0:
$ python -c 'import matplotlib.testing as t; print(t.noseclasses)'
Traceback (most recent call last):
File "<string>", line 1, in <module>
AttributeError: module 'matplotlib.testing' has no attribute 'noseclasses'
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.
woot \o/ thanks for checking.
@anntzer It is now fixed. |
This pull request aims simply at making matplotlib.testing.nose an explicitely private module.
In practice, it is already almost invisible to the user, as not imported anywhere.