Skip to content

Commit 37ac31a

Browse files
committed
protect widgets import in test (python 2.6)
1 parent 7345c14 commit 37ac31a

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
1+
import six
12
from unittest import TestCase
23

3-
from plotly.widgets import GraphWidget
4+
version = six.sys.version_info[:2] # need this for conditional testing
45

6+
# unittest `skip` not supported in 2.6 and IPython not supported in 2.6/3.2
7+
if version < (2, 7) or (2, 7) < version < (3, 3):
8+
pass
9+
else:
10+
from plotly.widgets import GraphWidget
511

6-
class TestWidgets(TestCase):
712

8-
def test_instantiate_graph_widget(self):
9-
widget = GraphWidget
13+
class TestWidgets(TestCase):
14+
15+
def test_instantiate_graph_widget(self):
16+
widget = GraphWidget

0 commit comments

Comments
 (0)