Skip to content

Commit d39f9c0

Browse files
committed
Merge pull request matplotlib#1951 from mdboom/parallelize_tests
parallelize_tests
2 parents 51107ea + 08ba300 commit d39f9c0

File tree

14 files changed

+32
-35017
lines changed

14 files changed

+32
-35017
lines changed

.travis.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,20 @@ python:
77
- 3.3
88

99
install:
10-
- pip install --use-mirrors nose python-dateutil numpy
10+
- pip -q install --use-mirrors nose python-dateutil numpy
1111
# This is a workaround to install the latest versions of pyparsing,
1212
# which are not yet available on PyPI
13-
- 'if [ ${TRAVIS_PYTHON_VERSION:0:1} == "3" ]; then pip install http://sourceforge.net/projects/pyparsing/files/pyparsing/pyparsing-2.0.0/pyparsing-2.0.0.tar.gz; fi'
14-
- 'if [ ${TRAVIS_PYTHON_VERSION:0:1} == "2" ]; then pip install http://sourceforge.net/projects/pyparsing/files/pyparsing/pyparsing-1.5.7/pyparsing-1.5.7.tar.gz; fi'
15-
- if [[ $TRAVIS_PYTHON_VERSION == '2.'* ]]; then pip install --use-mirrors PIL; fi
16-
- sudo apt-get update && sudo apt-get install inkscape
13+
- 'if [ ${TRAVIS_PYTHON_VERSION:0:1} == "3" ]; then pip -q install http://sourceforge.net/projects/pyparsing/files/pyparsing/pyparsing-2.0.0/pyparsing-2.0.0.tar.gz; fi'
14+
- 'if [ ${TRAVIS_PYTHON_VERSION:0:1} == "2" ]; then pip -q install http://sourceforge.net/projects/pyparsing/files/pyparsing/pyparsing-1.5.7/pyparsing-1.5.7.tar.gz; fi'
15+
- if [[ $TRAVIS_PYTHON_VERSION == '2.'* ]]; then pip -q install --use-mirrors PIL; fi
16+
- sudo apt-get update && sudo apt-get -qq install inkscape
1717
- python setup.py install
1818

1919
script:
2020
- mkdir ../tmp_test_dir
2121
- cd ../tmp_test_dir
22-
- python ../matplotlib/tests.py -sv
22+
# The number of processes is hardcoded, because using too many causes the
23+
# Travis VM to run out of memory (since so many copies of inkscape and
24+
# ghostscript are running at the same time).
25+
- echo Testing using 8 processes
26+
- python ../matplotlib/tests.py -sv --processes=8 --process-timeout=300

lib/matplotlib/__init__.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1172,10 +1172,13 @@ def tk_window_focus():
11721172

11731173
default_test_modules = [
11741174
'matplotlib.tests.test_agg',
1175+
'matplotlib.tests.test_arrow_patches',
11751176
'matplotlib.tests.test_artist',
11761177
'matplotlib.tests.test_axes',
1177-
'matplotlib.tests.test_backend_svg',
1178+
'matplotlib.tests.test_backend_pdf',
11781179
'matplotlib.tests.test_backend_pgf',
1180+
'matplotlib.tests.test_backend_qt4',
1181+
'matplotlib.tests.test_backend_svg',
11791182
'matplotlib.tests.test_basic',
11801183
'matplotlib.tests.test_bbox_tight',
11811184
'matplotlib.tests.test_cbook',
@@ -1196,6 +1199,7 @@ def tk_window_focus():
11961199
'matplotlib.tests.test_path',
11971200
'matplotlib.tests.test_patheffects',
11981201
'matplotlib.tests.test_pickle',
1202+
'matplotlib.tests.test_png',
11991203
'matplotlib.tests.test_rcparams',
12001204
'matplotlib.tests.test_scale',
12011205
'matplotlib.tests.test_simplification',
@@ -1205,10 +1209,8 @@ def tk_window_focus():
12051209
'matplotlib.tests.test_text',
12061210
'matplotlib.tests.test_ticker',
12071211
'matplotlib.tests.test_tightlayout',
1208-
'matplotlib.tests.test_triangulation',
12091212
'matplotlib.tests.test_transforms',
1210-
'matplotlib.tests.test_arrow_patches',
1211-
'matplotlib.tests.test_backend_qt4',
1213+
'matplotlib.tests.test_triangulation',
12121214
]
12131215

12141216

lib/matplotlib/testing/compare.py

Lines changed: 11 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import matplotlib
1010
from matplotlib.compat import subprocess
1111
from matplotlib.testing.noseclasses import ImageComparisonFailure
12-
from matplotlib.testing import image_util, util
12+
from matplotlib.testing import image_util
1313
from matplotlib import _png
1414
from matplotlib import _get_configdir
1515
from distutils import version
@@ -141,28 +141,16 @@ def convert(old, new):
141141
return convert
142142

143143
if matplotlib.checkdep_ghostscript() is not None:
144-
def make_ghostscript_conversion_command():
145-
# FIXME: make checkdep_ghostscript return the command
146-
if sys.platform == 'win32':
147-
gs = 'gswin32c'
148-
else:
149-
gs = 'gs'
150-
cmd = [gs, '-q', '-sDEVICE=png16m', '-sOutputFile=-']
151-
152-
process = util.MiniExpect(cmd)
153-
154-
def do_convert(old, new):
155-
process.expect("GS>")
156-
process.sendline("(%s) run" % old.replace('\\', '/'))
157-
with open(new, 'wb') as fd:
158-
process.expect(">>showpage, press <return> to continue<<", fd)
159-
process.sendline('')
160-
161-
return do_convert
162-
163-
converter['pdf'] = make_ghostscript_conversion_command()
164-
converter['eps'] = make_ghostscript_conversion_command()
165-
144+
if sys.platform == 'win32':
145+
gs = 'gswin32c'
146+
else:
147+
gs = 'gs'
148+
149+
cmd = lambda old, new: \
150+
[gs, '-q', '-sDEVICE=png16m', '-dNOPAUSE', '-dBATCH',
151+
'-sOutputFile=' + new, old]
152+
converter['pdf'] = make_external_conversion_command(cmd)
153+
converter['eps'] = make_external_conversion_command(cmd)
166154

167155
if matplotlib.checkdep_inkscape() is not None:
168156
cmd = lambda old, new: \

lib/matplotlib/testing/decorators.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import matplotlib
77
import matplotlib.tests
88
import matplotlib.units
9+
from matplotlib import cbook
910
from matplotlib import ticker
1011
from matplotlib import pyplot as plt
1112
from matplotlib import ft2font
@@ -281,6 +282,6 @@ def find_dotted_module(module_name, path=None):
281282
result_dir = os.path.abspath(os.path.join('result_images', subdir))
282283

283284
if not os.path.exists(result_dir):
284-
os.makedirs(result_dir)
285+
cbook.mkdirs(result_dir)
285286

286287
return baseline_dir, result_dir

lib/matplotlib/testing/util.py

Lines changed: 0 additions & 76 deletions
This file was deleted.
Binary file not shown.

0 commit comments

Comments
 (0)