Skip to content

Commit

Permalink
Merge pull request #471 from pelson/gridliner_test_gtkagg
Browse files Browse the repository at this point in the history
Fixed the gridliner test to handle backends which do not correctly trigger draw (e.g. GtkAgg).
  • Loading branch information
rhattersley committed Aug 22, 2014
2 parents 82e5c2c + 9ea6131 commit 7b403b0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/cartopy/tests/mpl/test_gridliner.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import unittest
import warnings

from matplotlib.backends.backend_agg import FigureCanvasAgg
import matplotlib.pyplot as plt
import matplotlib.ticker as mticker
from nose.tools import assert_raises
Expand Down Expand Up @@ -139,7 +140,8 @@ def test_grid_labels():

# trigger a draw at this point and check the appropriate artists are
# populated on the gridliner instance
plt.draw()
FigureCanvasAgg(plt.gcf()).draw()

assert len(gl.xlabel_artists) == 4
assert len(gl.ylabel_artists) == 5
assert len(gl.ylabel_artists) == 5
Expand Down

0 comments on commit 7b403b0

Please sign in to comment.