diff --git a/geoviews/tests/plotting/mpl/test_chart.py b/geoviews/tests/plotting/mpl/test_chart.py index ed3d11a1..d80b8593 100644 --- a/geoviews/tests/plotting/mpl/test_chart.py +++ b/geoviews/tests/plotting/mpl/test_chart.py @@ -4,12 +4,12 @@ from geoviews.element import WindBarbs -from holoviews.tests.plotting.matplotlib.test_plot import TestMPLPlot from holoviews.tests.plotting.utils import ParamLogStream from geoviews import Store -gv.extension("matplotlib") +from test_plot import TestMPLPlot + mpl_renderer = Store.renderers["matplotlib"] diff --git a/geoviews/tests/plotting/mpl/test_plot.py b/geoviews/tests/plotting/mpl/test_plot.py new file mode 100644 index 00000000..8322f118 --- /dev/null +++ b/geoviews/tests/plotting/mpl/test_plot.py @@ -0,0 +1,29 @@ +import matplotlib.pyplot as plt +import pyviz_comms as comms + +from geoviews import Store +from geoviews.element.comparison import ComparisonTestCase +from geoviews.plotting.mpl import ElementPlot +from param import concrete_descendents + +mpl_renderer = Store.renderers['matplotlib'] + + +class TestMPLPlot(ComparisonTestCase): + + def setUp(self): + self.previous_backend = Store.current_backend + self.comm_manager = mpl_renderer.comm_manager + mpl_renderer.comm_manager = comms.CommManager + Store.set_current_backend('matplotlib') + self._padding = {} + for plot in concrete_descendents(ElementPlot).values(): + self._padding[plot] = plot.padding + plot.padding = 0 + + def tearDown(self): + Store.current_backend = self.previous_backend + mpl_renderer.comm_manager = self.comm_manager + plt.close(plt.gcf()) + for plot, padding in self._padding.items(): + plot.padding = padding