Skip to content

Commit c0933b9

Browse files
committed
refactored testing tools so matplotlib doesn't need to be installed.
1 parent 668567a commit c0933b9

File tree

2 files changed

+14
-11
lines changed

2 files changed

+14
-11
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
from __future__ import absolute_import
2+
3+
import matplotlib
4+
# Force matplotlib to not use any Xwindows backend.
5+
matplotlib.use('Agg')
6+
from plotly.matplotlylib import Exporter, PlotlyRenderer
7+
from plotly.tests.utils import *
8+
9+
10+
def run_fig(fig):
11+
renderer = PlotlyRenderer()
12+
exporter = Exporter(renderer)
13+
exporter.run(fig)
14+
return renderer

plotly/tests/test_optional/test_matplotlylib/nose_tools.py renamed to plotly/tests/utils.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
from __future__ import absolute_import
2-
3-
import matplotlib
4-
# Force matplotlib to not use any Xwindows backend.
5-
matplotlib.use('Agg')
6-
from plotly.matplotlylib import Exporter, PlotlyRenderer
71
from numbers import Number as Num
82

93

@@ -56,8 +50,3 @@ def is_num_list(item):
5650
return True
5751

5852

59-
def run_fig(fig):
60-
renderer = PlotlyRenderer()
61-
exporter = Exporter(renderer)
62-
exporter.run(fig)
63-
return renderer

0 commit comments

Comments
 (0)