-
Notifications
You must be signed in to change notification settings - Fork 24
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
Add deprecation warning for apptools.undo #250
Conversation
…st importing from undo subpackage results in the warning
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.
Two somewhat orthogonal issues:
(1) apptools test suite is emitting this deprecation warning. I believe they all come from the undo's own test suite. With that, they are false alarms and should be handled either by filtering the warning or by modifying the imports such that the warning is not emitted.
(2) The tests added are failing precisely because apptools test suite has already caused the warning to be emitted at import time. Importing the test module itself requiring importing __init__
prior to the test being run. Trying to import apptools.undo.api
is not going to execute the module again because imported modules are cached.
I am not sure it is worth the effort in testing these import-time warnings. It is important though to make sure the __init__
's can still run, i.e. there are no silly syntax errors and the like that would prevent the entire package from being imported. Since there are tests in apptools.undo
, the apptools.undo.__init__
is covered. But I am not sure if apptools.undo.action.__init__
has been covered by tests, could you check please?
I ran coverage on the undo tests, without the |
Right, it is probably covered by unittest discovery itself, fair enough. |
I tried adding a filter I am still seeing a warning. The warning it says is coming from |
Actually, we are fighting ourselves here. When we run the test suite, we set That's all because the warning is in |
Ah I see, that makes sense. I guess I will remove the warning filters then, as they aren't really doing anything |
Yep, SGTM. |
Should've looked at this before it was merged but this PR definitely needed a news fragment |
fixes #243
Pyface 7.2 is about to be release and as a result
apptools.undo
needs to be deprecated. This PR adds a deprecation warning toapptools.undo.__init__.py
andapptools.undo.action.__init__.py
so that importing fromapptools.undo
will raise a deprecation warning. It also adds a test to verify deprecation warnings are raised when importing the api modules.Checklist