Skip to content

Commit

Permalink
Skip selection tests if plotting backend not available
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Oct 4, 2019
1 parent 00a6ccf commit 9ba17a7
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions holoviews/tests/testselection.py
Expand Up @@ -3,6 +3,7 @@
import holoviews as hv
import pandas as pd

from holoviews.core.options import Store
from holoviews.selection import link_selections
from holoviews.element.comparison import ComparisonTestCase

Expand Down Expand Up @@ -295,8 +296,16 @@ def test_scatter_selection_streaming(self):
# Backend implementations
class TestLinkSelectionsPlotly(TestLinkSelections):
def setUp(self):
try:
import holoviews.plotting.plotly # noqa
except:
raise SkipTest("Plotly selection tests require plotly.")
super(TestLinkSelectionsPlotly, self).setUp()
hv.extension('plotly')
self._backend = Store.current_backend
Store.set_current_backend('plotly')

def tearDown(self):
Store.current_backend = self._backend

def element_color(self, element):
if isinstance(element, hv.Table):
Expand All @@ -315,8 +324,16 @@ def element_visible(self, element):

class TestLinkSelectionsBokeh(TestLinkSelections):
def setUp(self):
try:
import holoviews.plotting.bokeh # noqa
except:
raise SkipTest("Bokeh selection tests require bokeh.")
super(TestLinkSelectionsBokeh, self).setUp()
hv.extension('bokeh')
self._backend = Store.current_backend
Store.set_current_backend('bokeh')

def tearDown(self):
Store.current_backend = self._backend

def element_color(self, element):
color = element.opts.get('style').kwargs['color']
Expand Down

0 comments on commit 9ba17a7

Please sign in to comment.