Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a3185e6

Browse files
author
Alexis Bienvenüe
committed
Allow parallel execution of test_backend_ps:test_determinism_all_tex and test_determinism_all
1 parent 6ee8967 commit a3185e6

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

lib/matplotlib/testing/determinism.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def _test_determinism_save(filename, objects='mhi', format="pdf"):
6060
os.environ['SOURCE_DATE_EPOCH'] = sde
6161

6262

63-
def _test_determinism(objects='mhi', format="pdf"):
63+
def _test_determinism(objects='mhi', format="pdf", uid=""):
6464
"""
6565
Output three times the same graphs and checks that the outputs are exactly
6666
the same.
@@ -73,11 +73,14 @@ def _test_determinism(objects='mhi', format="pdf"):
7373
default value is "mhi", so that the test includes all these objects.
7474
format : str
7575
format string. The default value is "pdf".
76+
uid : str
77+
some string to add to the filename used to store the output. Use it to
78+
allow parallel execution of two tests with the same objects parameter.
7679
"""
7780
import sys
7881
from subprocess import check_call
7982
from nose.tools import assert_equal
80-
filename = 'determinism_O%s.%s' % (objects, format)
83+
filename = 'determinism_O%s%s.%s' % (objects, uid, format)
8184
plots = []
8285
for i in range(3):
8386
check_call([sys.executable, '-R', '-c',

lib/matplotlib/tests/test_backend_ps.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ def test_determinism_all():
198198
def test_determinism_all_tex():
199199
"""Test for reproducible PS/tex output"""
200200
matplotlib.rcParams['text.usetex'] = True
201-
_test_determinism(format="ps")
201+
_test_determinism(format="ps",uid="_tex")
202202

203203

204204
if __name__ == '__main__':

0 commit comments

Comments
 (0)