1- # TODO: matplotlib-build-wip
2- from nose .plugins .attrib import attr
3- from plotly .tools import _matplotlylib_imported
1+ from ..exporter import Exporter
2+ from ..renderers import FakeRenderer , FullFakeRenderer
43
5- if _matplotlylib_imported :
6- from .. exporter import Exporter
7- from .. renderers import FakeRenderer , FullFakeRenderer
4+ import matplotlib
5+ matplotlib . use ( 'Agg' )
6+ import matplotlib . pyplot as plt
87
9- import matplotlib
10- matplotlib .use ('Agg' )
11- import matplotlib .pyplot as plt
8+ import numpy as np
9+ from numpy .testing import assert_warns
1210
13- import numpy as np
14- from numpy .testing import assert_warns
1511
16-
17- @attr ('matplotlib' )
1812def fake_renderer_output (fig , Renderer ):
1913 renderer = Renderer ()
2014 exporter = Exporter (renderer )
2115 exporter .run (fig )
2216 return renderer .output
2317
2418
25- @attr ('matplotlib' )
2619def _assert_output_equal (text1 , text2 ):
2720 for line1 , line2 in zip (text1 .strip ().split (), text2 .strip ().split ()):
2821 assert line1 == line2
2922
3023
31- @attr ('matplotlib' )
3224def test_lines ():
3325 fig , ax = plt .subplots ()
3426 ax .plot (range (20 ), '-k' )
@@ -52,7 +44,6 @@ def test_lines():
5244 """ )
5345
5446
55- @attr ('matplotlib' )
5647def test_markers ():
5748 fig , ax = plt .subplots ()
5849 ax .plot (range (2 ), 'ok' )
@@ -77,7 +68,6 @@ def test_markers():
7768 """ )
7869
7970
80- @attr ('matplotlib' )
8171def test_path_collection ():
8272 fig , ax = plt .subplots ()
8373 ax .scatter (range (3 ), range (3 ))
@@ -103,7 +93,6 @@ def test_path_collection():
10393 """ )
10494
10595
106- @attr ('matplotlib' )
10796def test_text ():
10897 fig , ax = plt .subplots ()
10998 ax .set_xlabel ("my x label" )
@@ -124,7 +113,6 @@ def test_text():
124113 """ )
125114
126115
127- @attr ('matplotlib' )
128116def test_path ():
129117 fig , ax = plt .subplots ()
130118 ax .add_patch (plt .Circle ((0 , 0 ), 1 ))
@@ -141,7 +129,6 @@ def test_path():
141129 """ )
142130
143131
144- @attr ('matplotlib' )
145132def test_multiaxes ():
146133 fig , ax = plt .subplots (2 )
147134 ax [0 ].plot (range (4 ))
@@ -160,7 +147,6 @@ def test_multiaxes():
160147 """ )
161148
162149
163- @attr ('matplotlib' )
164150def test_image ():
165151 np .random .seed (0 ) # image size depends on the seed
166152 fig , ax = plt .subplots ()
@@ -177,7 +163,6 @@ def test_image():
177163 """ )
178164
179165
180- @attr ('matplotlib' )
181166def test_legend ():
182167 fig , ax = plt .subplots ()
183168 ax .plot ([1 ,2 ,3 ], label = 'label' )
@@ -193,8 +178,6 @@ def test_legend():
193178 closing figure
194179 """ )
195180
196-
197- @attr ('matplotlib' )
198181def test_legend_dots ():
199182 fig , ax = plt .subplots ()
200183 ax .plot ([1 ,2 ,3 ], label = 'label' )
@@ -217,9 +200,8 @@ def test_legend_dots():
217200 closing figure
218201 """ )
219202
220-
221- @attr ('matplotlib' )
222203def test_blended ():
223204 fig , ax = plt .subplots ()
224205 ax .axvline (0 )
225206 assert_warns (UserWarning , fake_renderer_output , fig , FakeRenderer )
207+
0 commit comments