Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ahuang11 committed Jul 5, 2023
1 parent 8a0de31 commit c11a05e
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
4 changes: 2 additions & 2 deletions geoviews/tests/plotting/mpl/test_chart.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]


Expand Down
29 changes: 29 additions & 0 deletions geoviews/tests/plotting/mpl/test_plot.py
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit c11a05e

Please sign in to comment.