File tree 1 file changed +18
-7
lines changed
plotly/tests/test_optional/test_offline
1 file changed +18
-7
lines changed Original file line number Diff line number Diff line change 5
5
from __future__ import absolute_import
6
6
7
7
from nose .tools import raises
8
+ from nose .plugins .attrib import attr
9
+
8
10
from unittest import TestCase
9
11
import json
10
12
20
22
import matplotlib .pyplot as plt
21
23
22
24
23
- # Generate matplotlib plot for tests
24
- fig = plt .figure ()
25
-
26
- x = [10 , 20 , 30 ]
27
- y = [100 , 200 , 300 ]
28
- plt .plot (x , y , "o" )
29
-
30
25
PLOTLYJS = plotly .offline .offline .get_plotlyjs ()
31
26
32
27
@@ -43,13 +38,29 @@ def test_iplot_works_after_you_call_init_notebook_mode(self):
43
38
plotly .offline .init_notebook_mode ()
44
39
plotly .offline .iplot ([{}])
45
40
41
+ @attr ('matplotlib' )
46
42
def test_iplot_mpl_works_after_you_call_init_notebook_mode (self ):
43
+ # Generate matplotlib plot for tests
44
+ fig = plt .figure ()
45
+
46
+ x = [10 , 20 , 30 ]
47
+ y = [100 , 200 , 300 ]
48
+ plt .plot (x , y , "o" )
49
+
47
50
plotly .tools ._ipython_imported = True
48
51
plotly .offline .init_notebook_mode ()
49
52
plotly .offline .iplot_mpl (fig )
50
53
51
54
55
+ @attr ('matplotlib' )
52
56
class PlotlyOfflineMPLTestCase (TestCase ):
57
+ # Generate matplotlib plot for tests
58
+ fig = plt .figure ()
59
+
60
+ x = [10 , 20 , 30 ]
61
+ y = [100 , 200 , 300 ]
62
+ plt .plot (x , y , "o" )
63
+
53
64
def setUp (self ):
54
65
pass
55
66
You can’t perform that action at this time.
0 commit comments