Created
April 18, 2026 09:00
-
-
Save rcomer/d2d506d626375300bd3d0e88aa4ea624 to your computer and use it in GitHub Desktop.
Basic script for eyeballing pytest-mpl failures
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import argparse | |
| import pathlib | |
| import subprocess as sp | |
| parser = argparse.ArgumentParser( | |
| description='Compare failed image comparisons from pytest-mpl') | |
| parser.add_argument("path", type=pathlib.Path, help="Directory path") | |
| args = parser.parse_args() | |
| path = pathlib.Path(args.path) | |
| for subpath in path.glob('*'): | |
| if subpath.is_dir(): | |
| fail_diff = subpath / 'result-failed-diff.png' | |
| if not fail_diff.exists(): | |
| continue | |
| baseline = subpath / 'baseline.png' | |
| result = subpath / 'result.png' | |
| print(subpath) | |
| processes = [] | |
| processes.append(sp.Popen(['eog', '-n', baseline, result])) | |
| processes.append(sp.Popen(['eog', '-n', fail_diff])) | |
| for process in processes: | |
| process.wait() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment