Skip to content

Commit

Permalink
Fixed the gridliner test to handle backends which do not correctly tr…
Browse files Browse the repository at this point in the history
…igger draw (e.g. GtkAgg).
  • Loading branch information
pelson committed Aug 21, 2014
1 parent 9aaaa57 commit 9ea6131
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 9ea6131

Please sign in to comment.