Skip to content

plot tests: each image is now a separate test#202

Merged
ilia-kats merged 1 commit into
mainfrom
plotting_tests
Jun 9, 2026
Merged

plot tests: each image is now a separate test#202
ilia-kats merged 1 commit into
mainfrom
plotting_tests

Conversation

@ilia-kats

Copy link
Copy Markdown
Collaborator

Matplotlib's image_comparison decorator can compare multiple images, but it raises an exception on the first mismatched image, aborting the test. This is annoying, since a test needs to be re-run multiple times to update all its baseline images.

This PR implements a custom pytest collector to treat each image comparison as a separate test, so e.g. plotnine updates can be handled in a single run.

@codecov

codecov Bot commented Jun 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.20%. Comparing base (2ce965a) to head (0f96d5b).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #202   +/-   ##
=======================================
  Coverage   90.20%   90.20%           
=======================================
  Files          56       56           
  Lines        5811     5811           
=======================================
  Hits         5242     5242           
  Misses        569      569           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Matplotlib's image_comparison decorator can compare multiple images, but
it raises an exception on the first mismatched image, aborting the test.
This is annoying, since a test needs to be re-run multiple times to
update all its baseline images. Implement a custom pytest collector to
treat each image comparison as a separate test, so e.g. plotnine updates
can be handled in a single run.
@arberqoku arberqoku self-assigned this Jun 9, 2026
@ilia-kats ilia-kats merged commit a4b7bc0 into main Jun 9, 2026
9 checks passed
@ilia-kats ilia-kats deleted the plotting_tests branch June 9, 2026 17:03
ilia-kats added a commit that referenced this pull request Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants