10000 Merge pull request #7674 from QuLogic/serialize-baseline-compare · matplotlib/matplotlib@c21d189 · GitHub
[go: up one dir, main page]

Skip to content

Commit c21d189

Browse files
authored
Merge pull request #7674 from QuLogic/serialize-baseline-compare
TST: Serialize comparison of multiple baseline images.
2 parents c4caab8 + dfe0f63 commit c21d189

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

lib/matplotlib/testing/decorators.py

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -317,12 +317,22 @@ def pytest_runner(self):
317317

318318
extensions = map(mark_xfail_if_format_is_uncomparable, self.extensions)
319319

320-
@mark.parametrize("extension", extensions)
321-
@mark.parametrize("idx,baseline", enumerate(self.baseline_images))
322-
@checked_on_freetype_version(self.freetype_version)
323-
def wrapper(idx, baseline, extension):
324-
__tracebackhide__ = True
325-
self.compare(idx, baseline, extension)
320+
if len(set(self.baseline_images)) == len(self.baseline_images):
321+
@mark.parametrize("extension", extensions)
322+
@mark.parametrize("idx,baseline", enumerate(self.baseline_images))
323+
@checked_on_freetype_version(self.freetype_version)
324+
def wrapper(idx, baseline, extension):
325+
__tracebackhide__ = True
326+
self.compare(idx, baseline, extension)
327+
else:
328+
# Some baseline images are repeated, so run this in serial.
329+
@mark.parametrize("extension", extensions)
330+
@checked_on_freetype_version(self.freetype_version)
331+
def wrapper(extension):
332+
__tracebackhide__ = True
333+
for idx, baseline in enumerate(self.baseline_images):
334+
self.compare(idx, baseline, extension)
335+
326336

327337
# sadly we cannot use fixture here because of visibility problems
328338
# and for for obvious reason avoid `nose.tools.with_setup`

0 commit comments

Comments
 (0)
0