File tree Expand file tree Collapse file tree 1 file changed +18
-7
lines changed
plotly/tests/test_optional/test_offline Expand file tree Collapse file tree 1 file changed +18
-7
lines changed Original file line number Diff line number Diff line change 55from __future__ import absolute_import
66
77from nose .tools import raises
8+ from nose .plugins .attrib import attr
9+
810from unittest import TestCase
911import json
1012
2022 import matplotlib .pyplot as plt
2123
2224
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-
3025PLOTLYJS = plotly .offline .offline .get_plotlyjs ()
3126
3227
@@ -43,13 +38,29 @@ def test_iplot_works_after_you_call_init_notebook_mode(self):
4338 plotly .offline .init_notebook_mode ()
4439 plotly .offline .iplot ([{}])
4540
41+ @attr ('matplotlib' )
4642 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+
4750 plotly .tools ._ipython_imported = True
4851 plotly .offline .init_notebook_mode ()
4952 plotly .offline .iplot_mpl (fig )
5053
5154
55+ @attr ('matplotlib' )
5256class 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+
5364 def setUp (self ):
5465 pass
5566
You can’t perform that action at this time.
0 commit comments