Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Remove figure from Gcf when it is closed #1683

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

Closed
wants to merge 11 commits into from
Prev Previous commit
Next Next commit
added knownfailureif to test based on if qt4_compat could be imported,
as this should hit either PySide or PyQt4, depending on which is
installed.  (I have faith that the setup code that will make sure that
if only one of them is installed, it defaults to using that one)
  • Loading branch information
tacaswell committed Jan 23, 2013
commit def3327ee7d4da22a39b598b8c6b460b855d587e
8 changes: 8 additions & 0 deletions 8 lib/matplotlib/tests/test_backend_qt4.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
from matplotlib import pyplot as plt
from matplotlib.testing.decorators import cleanup
from matplotlib.testing.decorators import knownfailureif
from matplotlib._pylab_helpers import Gcf
import copy

try:
import matplotlib.backends.qt4_compat
HAS_QT = True
except ImportError:
HAS_QT = False


@cleanup
@knownfailureif(not HAS_QT)
def test_fig_close():
# force switch to the Qt4 backend
plt.switch_backend('Qt4Agg')
Copy link
Member

Choose a reason for hiding this comment

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

We should probably mark this test as knownfail or skip if Qt4/PySide are not installed.

Copy link
Member Author

Choose a reason for hiding this comment

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

What is the correct way to test if Qt4/PySide is available?

Copy link
Member

Choose a reason for hiding this comment

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

Something like:

try:
    import Qt
    HAS_PYQT = True
except ImportError:
    HAS_PYQT = False

(And obviously extend to also check for PySide -- it should be good enough to have one or the other).

Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.