Skip to content
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

Suppress matplotlib warnings on non-GUI use of show() #5749

Merged

Conversation

pavoljuhas
Copy link
Collaborator

Tests intentionally use a non-GUI matplotlib backend "agg".
Reduce clutter in the pytest output.

Tests intentionally use a non-GUI matplotlib backend "agg".
@pavoljuhas pavoljuhas requested review from a team, vtomole and cduck as code owners July 13, 2022 04:24
@pavoljuhas pavoljuhas requested a review from mpharrigan July 13, 2022 04:24
@CirqBot CirqBot added the Size: XS <10 lines changed label Jul 13, 2022
@mhucka
Copy link
Contributor

mhucka commented Jul 13, 2022

Thank you for this. Just yesterday I was trying to figure out why I was getting these warnings and how to stop them (perhaps via changing the matplotlib backend). Now I see I was barking up the wrong tree.

@pavoljuhas
Copy link
Collaborator Author

Of course. :) Another option to stop them would be to unset DISPLAY in one of the conftest.py files - https://github.com/matplotlib/matplotlib/blob/9d9ba8ae83714617e0264d1834563550560a8aca/lib/matplotlib/backend_bases.py#L2785-L2794
That is however not ideal, because people may run a debugger --> editor from within their test session which would be limited without DISPLAY.

@MichaelBroughton MichaelBroughton added the automerge Tells CirqBot to sync and merge this PR. (If it's running.) label Jul 18, 2022
@CirqBot CirqBot added the front_of_queue_automerge CirqBot uses this label to indicate (and remember) what's being merged next. label Jul 18, 2022
@CirqBot CirqBot merged commit 3c67cd7 into quantumlib:master Jul 18, 2022
@CirqBot CirqBot removed automerge Tells CirqBot to sync and merge this PR. (If it's running.) front_of_queue_automerge CirqBot uses this label to indicate (and remember) what's being merged next. labels Jul 18, 2022
@pavoljuhas pavoljuhas deleted the silence-matplotlib.show-warnings-in-tests branch July 18, 2022 22:29
rht pushed a commit to rht/Cirq that referenced this pull request May 1, 2023
Tests intentionally use a non-GUI matplotlib backend "agg".
Reduce clutter in the pytest output.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Size: XS <10 lines changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants