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

Qt closeevent fixes for v1.2.x #1705

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
merged 10 commits into from
Jan 28, 2013
Prev Previous commit
Next Next commit
test for issue #1683
  • Loading branch information
tacaswell committed Jan 26, 2013
commit 75a92df91a059f87fe3be956adef44765346c9e2
19 changes: 17 additions & 2 deletions 19 lib/matplotlib/tests/test_backend_qt4.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,25 @@
from matplotlib import rcParams
from matplotlib import pyplot as plt
from matplotlib.testing.decorators import cleanup
from matplotlib._pylab_helpers import Gcf
import copy


@cleanup
def test_fig_close():
rcParams['backend'] = 'qt4agg'
# force switch to the Qt4 backend
plt.switch_backend('Qt4Agg')

#save the state of Gcf.figs
init_figs = copy.copy(Gcf.figs)

# make a figure using pyplot interface
fig = plt.figure()
fig.close()

# simulate user clicking the close button by reaching in
# and calling close on the underlying Qt object
fig.canvas.manager.window.close()

# assert that we have removed the reference to the FigureManager
# that got added by plt.figure()
assert(init_figs == Gcf.figs)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.