Skip to content

Improve text element removal and fix test file name in workflow - #22

Merged
jgieseler merged 2 commits into
spearhead-he:mainfrom
jgieseler:main
Jul 6, 2026
Merged

jgieseler merged 2 commits into
spearhead-he:mainfrom
jgieseler:main

Conversation

@jgieseler

@jgieseler jgieseler commented Jul 6, 2026 •

Copy link
Copy Markdown
Member

This pull request updates the test suite to improve compatibility and reliability of matplotlib image comparisons and to clarify test file naming. The main change is adding a helper function to strip variable text from matplotlib figures before comparison.

Test infrastructure improvements:

  • Renamed the main test file from test.py to test_.py and updated all references in documentation and CI configuration to use the new filename. This follows standards.
  • Updated the GitHub Actions workflow (.github/workflows/pytest.yml) to run tests using test_.py instead of test.py.

Matplotlib image comparison enhancements:

  • Added a new helper function strip_figure_text in bowtie/tests/helpers.py to remove all text elements from matplotlib figures that can vary across versions (titles, labels, legends, etc.), ensuring more robust image comparison in tests.
  • Modified tests to use strip_figure_text before returning figures for comparison, in addition to the existing remove_text=True option, for improved consistency.

@codecov

codecov Bot commented Jul 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.75000% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
bowtie/tests/helpers.py 92.85% 1 Missing ⚠️
Files with missing lines Coverage Δ
bowtie/tests/test_.py 100.00% <100.00%> (ø)
bowtie/tests/helpers.py 92.85% <92.85%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jgieseler
jgieseler merged commit 12ee266 into spearhead-he:main Jul 6, 2026
6 checks passed
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.

1 participant