Skip to content

TST: Run the new univariate tests without matplotlib - #960

Merged
bashtage merged 1 commit into
mainfrom
a90-fix-tests-without-matplotlib
Oct 18, 2026
Merged

bashtage merged 1 commit into
mainfrom
a90-fix-tests-without-matplotlib

Conversation

@bashtage

Copy link
Copy Markdown
Owner

Branch a90-fix-tests-without-matplotlib, one commit on main 80d3688.

The arch-wheels trial run (after arch-wheels#29) failed on every platform and
Python version. One cause was the 7 dtype tests that #957 has since fixed. The
other is still on main: three test modules that are new in this release import
matplotlib.pyplot at module level:

  • arch/tests/univariate/test_positions_and_alias.py
  • arch/tests/univariate/test_string_options.py
  • arch/tests/univariate/test_validation_base.py

The arch-wheels test environment does not install matplotlib, so these modules
fail to be collected (ModuleNotFoundError: No module named 'matplotlib').
arch's own CI always installs matplotlib, so it never showed there.

Fix (tests only), following the existing tests (test_hedgehog_plot.py,
test_mean.py):

  • import matplotlib.pyplot only if arch.compat.matplotlib.HAS_MATPLOTLIB;
  • skip the plot and hedgehog_plot tests and table rows without it;
  • close figures only when matplotlib is available.

With matplotlib blocked (the three modules, one process): 854 passed, 133
skipped, 0 failed (before: collection errors, and 349 failures once the import
was guarded but the plot tests were not skipped). With matplotlib: fast suite
26,955 passed.

🤖 Generated with Claude Code

test_positions_and_alias.py, test_string_options.py and test_validation_base.py
imported matplotlib.pyplot at module level, so they could not be collected where
matplotlib is not installed, as in the tests of the arch-wheels builds. Import it only
if it is available, as the other tests do, and skip the plot and hedgehog_plot tests
and table rows without it.
@bashtage
bashtage merged commit d2c90b4 into main Oct 18, 2026
13 of 23 checks passed
@bashtage
bashtage deleted the a90-fix-tests-without-matplotlib branch October 18, 2026 14:24
@codecov

codecov Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 73.68421% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 98.95%. Comparing base (80d3688) to head (310a5b1).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
arch/tests/univariate/test_validation_base.py 62.50% 1 Missing and 2 partials ⚠️
arch/tests/univariate/test_positions_and_alias.py 75.00% 0 Missing and 1 partial ⚠️
arch/tests/univariate/test_string_options.py 85.71% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #960      +/-   ##
==========================================
- Coverage   98.97%   98.95%   -0.02%     
==========================================
  Files         136      136              
  Lines       30028    30043      +15     
  Branches     2327     2331       +4     
==========================================
+ Hits        29719    29729      +10     
- Misses        255      256       +1     
- Partials       54       58       +4     
Flag Coverage Δ
adder 98.89% <73.68%> (-0.02%) ⬇️
subtractor 98.89% <73.68%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

bashtage added a commit that referenced this pull request Oct 18, 2026
Add a Linux job, python_313_no_matplotlib_wheel, that installs neither matplotlib nor
seaborn and tests the installed wheel from outside of the source tree, as the tests of
the arch-wheels builds do. The install step fails if another package installs
matplotlib anyway. A test module that imports matplotlib unconditionally, as three did
before #960, then fails to collect in CI instead of in the wheel builds.
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