Skip to content

Commit fdde5f7

Browse files
committed
MNT: special case the pdf for eps tests
1 parent e9ca65d commit fdde5f7

File tree

2 files changed

+2317
-2309
lines changed

2 files changed

+2317
-2309
lines changed

lib/matplotlib/testing/decorators.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,8 @@ def compare(self, fig, baseline, extension, *, _lock=False):
207207
self.md_path.parent.mkdir(parents=True, exist_ok=True)
208208
if self.mode == self._ImageCheckMode.GENERATE:
209209
rel_path = expected_path.relative_to(self.root_dir)
210-
210+
if rel_path not in md and rel_path.suffix == '.eps':
211+
rel_path = rel_path.with_suffix('.pdf')
211212
expected_path.parent.mkdir(parents=True, exist_ok=True)
212213
shutil.copyfile(actual_path, expected_path)
213214

@@ -224,6 +225,8 @@ def compare(self, fig, baseline, extension, *, _lock=False):
224225
)
225226
else:
226227
rel_path = actual_path.relative_to(self.result_dir.parent)
228+
if rel_path not in md and rel_path.suffix == '.eps':
229+
rel_path = rel_path.with_suffix('.pdf')
227230
if md[rel_path]['sha'] != self.image_revs[rel_path]['sha']:
228231
raise RuntimeError("Baseline images do not match checkout.")
229232
_raise_on_image_difference(expected_path, actual_path, self.tol)

0 commit comments

Comments
 (0)