Skip to content

Instantly share code, notes, and snippets.

@rcomer
Created April 18, 2026 09:00
Show Gist options
  • Select an option

  • Save rcomer/d2d506d626375300bd3d0e88aa4ea624 to your computer and use it in GitHub Desktop.

Select an option

Save rcomer/d2d506d626375300bd3d0e88aa4ea624 to your computer and use it in GitHub Desktop.
Basic script for eyeballing pytest-mpl failures
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