diff --git a/lib/matplotlib/projections/polar.py b/lib/matplotlib/projections/polar.py index c78faf7f728a..83664fe9e0dc 100644 --- a/lib/matplotlib/projections/polar.py +++ b/lib/matplotlib/projections/polar.py @@ -112,9 +112,6 @@ def get_matrix(self): return self._mtx get_matrix.__doc__ = Affine2DBase.get_matrix.__doc__ - def __getstate__(self): - return {} - class InvertedPolarTransform(Transform): """ diff --git a/lib/matplotlib/tests/test_pickle.py b/lib/matplotlib/tests/test_pickle.py index f41c2fad16b5..61dd963c4eda 100644 --- a/lib/matplotlib/tests/test_pickle.py +++ b/lib/matplotlib/tests/test_pickle.py @@ -126,6 +126,7 @@ def test_simple(): pickle.dump(fig, BytesIO(), pickle.HIGHEST_PROTOCOL) +@cleanup @image_comparison(baseline_images=['multi_pickle'], extensions=['png'], remove_text=True) def test_complete(): @@ -194,6 +195,7 @@ def test_complete(): assert_equal(fig.get_label(), 'Figure with a label?') +@cleanup def test_no_pyplot(): # tests pickle-ability of a figure not created with pyplot from matplotlib.backends.backend_pdf import FigureCanvasPdf as fc @@ -206,12 +208,14 @@ def test_no_pyplot(): pickle.dump(fig, BytesIO(), pickle.HIGHEST_PROTOCOL) +@cleanup def test_renderer(): from matplotlib.backends.backend_agg import RendererAgg renderer = RendererAgg(10, 20, 30) pickle.dump(renderer, BytesIO()) +@cleanup def test_image(): # Prior to v1.4.0 the Image would cache data which was not picklable # once it had been drawn. @@ -224,6 +228,7 @@ def test_image(): pickle.dump(fig, BytesIO()) +@cleanup def test_grid(): from matplotlib.backends.backend_agg import new_figure_manager manager = new_figure_manager(1000) @@ -237,6 +242,16 @@ def test_grid(): pickle.dump(ax, BytesIO()) +@cleanup +def test_polar(): + ax = plt.subplot(111, polar=True) + fig = plt.gcf() + result = BytesIO() + pf = pickle.dumps(fig) + pickle.loads(pf) + plt.draw() + + if __name__ == '__main__': import nose nose.runmodule(argv=['-s'])