8000 MAINT: Deterministic SVG and PDF tests by jkseppan · Pull Request #7748 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

MAINT: Deterministic SVG and PDF tests #7748

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jan 21, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Make pdf test results (more) deterministic
Remove the metadata entries that depend on the date and
the exact version.
  • Loading branch information
jkseppan committed Jan 5, 2017
commit 8c7adbb10b86f6ab83d79ca3c24cf5c96db9d65f
7 changes: 6 additions & 1 deletion lib/matplotlib/testing/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,12 @@ def compare(self, idx, baseline, extension):
remove_ticks_and_titles(fig)

actual_fname = os.path.join(self.result_dir, baseline) + '.' + extension
fig.savefig(actual_fname, **self.savefig_kwargs)
kwargs = self.savefig_kwargs.copy()
if extension == 'pdf':
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this break the test of SOURCE_DATE_EPOCH ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, that test starts a separate subprocess to write the output and doesn't use the image_comparison decorator at all.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, 🐑

kwargs.setdefault('metadata',
{'Creator': None, 'Producer': None,
'CreationDate': None})
fig.savefig(actual_fname, **kwargs)

expected_fname = self.copy_baseline(baseline, extension)
raise_on_image_difference(expected_fname, actual_fname, self.tol)
Expand Down
0