Skip to content

Commit 60a9025

Browse files
committed
add matplotlib attr tag to matplotlib tests
1 parent 2b57d3d commit 60a9025

File tree

1 file changed

+18
-7
lines changed

1 file changed

+18
-7
lines changed

plotly/tests/test_optional/test_offline/test_offline.py

+18-7
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
from __future__ import absolute_import
66

77
from nose.tools import raises
8+
from nose.plugins.attrib import attr
9+
810
from unittest import TestCase
911
import json
1012

@@ -20,13 +22,6 @@
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-
3025
PLOTLYJS = 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')
5256
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+
5364
def setUp(self):
5465
pass
5566

0 commit comments

Comments
 (0)