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

Close matplotlib figure windows cleanly in tests. #1648

Conversation

hodgestar
Copy link
Contributor

Close figure plots explicitly during tests so that the test suite passes when run headless under Xvfb.

Related issues or PRs

Changelog
Close figure plots explicitly during tests so that the test suite passes when run headless under Xvfb.

…produce an obscure error at the end of the test.
@hodgestar
Copy link
Contributor Author

@BoxiLi Would you be happy to apply this to qutip-qip too?

@drew-parsons Could you check that this works for you and that I haven't missed any other cases? The entire test suite passed for me, but one never knows.

Copy link
Member

@jakelishman jakelishman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, and I'm happy if it works without the nuclear option of pyplot.close('all').

@drew-parsons
Copy link
Contributor

Passes fine for me, patched onto 4.6.2.
Running tests locally,

...
tests/test_processor.py::TestCircuitProcessor::testPlot PASSED           [ 79%]
...
tests/test_wigner.py::test_wigner_clenshaw_sp_iter_dm PASSED             [100%]

=== 1910 passed, 20 skipped, 67 deselected, 53 warnings in 472.83s (0:07:52) ===
autopkgtest [16:47:24]: test test-qutip: -----------------------]
autopkgtest [16:47:24]: test test-qutip:  - - - - - - - - - - results - - - - - - - - - -
test-qutip           PASS
autopkgtest [16:47:24]: @@@@@@@@@@@@@@@@@@@@ summary
test-qutip           PASS

@hodgestar hodgestar added this to the QuTiP 4.6.3 milestone Aug 31, 2021
@hodgestar hodgestar merged commit d78b3b1 into qutip:master Aug 31, 2021
@hodgestar
Copy link
Contributor Author

@jakelishman @drew-parsons Thanks! Merged and marked for inclusion in 4.6.3.

@BoxiLi
Copy link
Member

BoxiLi commented Aug 31, 2021

@hodgestar Thanks for the fix. I'll add it also to qutip-qip.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 65.758% when pulling d08058b on hodgestar:feature/fix-processor-plot-test-under-xvfb-gh1639 into ac27129 on qutip:master.

BoxiLi added a commit to BoxiLi/qutip-qip that referenced this pull request Sep 7, 2021
See qutip/qutip#1648

Co-Authored-By: Simon Cross <165551+hodgestar@users.noreply.github.com>
Co-Authored-By: Drew Parsons <26508288+drew-parsons@users.noreply.github.com>
@hodgestar hodgestar deleted the feature/fix-processor-plot-test-under-xvfb-gh1639 branch December 9, 2021 14:35
hodgestar added a commit to hodgestar/qutip that referenced this pull request Feb 4, 2022
…ot-test-under-xvfb-gh1639

Close matplotlib figure windows cleanly in tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

processor plot tests succeed but return error
5 participants