-
Notifications
You must be signed in to change notification settings - Fork 949
Extend unit tests for the Output widget #1983
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
jasongrout
merged 19 commits into
jupyter-widgets:master
from
pbugnion:output-widget-tests
Mar 16, 2018
Merged
Extend unit tests for the Output widget #1983
jasongrout
merged 19 commits into
jupyter-widgets:master
from
pbugnion:output-widget-tests
Mar 16, 2018
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
By using functools.wraps, we avoid overwriting the __repr__ and __doc__ of the wrapped callback.
This is more consistent with the behaviour of the context manager, which does not clear the output every time it is entered.
The tests for the output widget now import the entire widget_output submodule, rather than just the Output widget itself. This allows monkeypatching the locals in widget_output for easier testing.
I think this looks great. Thanks! |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
resolved-locked
Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This builds on PR #1934, and the diff currently includes some commits from that PR.
While working on PR #1934, I felt that the test coverage on the Python side of the output widget was somewhat sparse. The difficulty is that a lot of the output widget code relies on
IPython.display
andIPython
methods. I've mocked these out in these tests (using manual monkeypatching, rather than introducing a dependency on a mocking library).