Skip to content

Conversation

@jsiirola
Copy link
Member

Fixes # .

Summary/Motivation:

Pytest 9.0.1 changed how expected failures worked with subTests, which broke Pyomo's unittest.timeout() decorator. This reworks how we handle unittest tests when running timeout() using the spawn (or forkserver) interface.

Changes proposed in this PR:

  • catch "one more" exception that can be raised for unpicklable objects
  • rework the unittest / spawn (or forkserver) implementation for unittest.timeout() to be compatible with pytest 9.0.1

Legal Acknowledgement

By contributing to this software project, I have read the contribution guide and agree to the following terms and conditions for my contribution:

  1. I agree my contributions are submitted under the BSD license.
  2. I represent I am authorized to make the contributions and grant the license. If my employer has rights to intellectual property that includes these contributions, I represent that I have received permission to make contributions and grant the required license on behalf of that employer.

@codecov
Copy link

codecov bot commented Nov 13, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.25%. Comparing base (4ce6049) to head (09e800b).
⚠️ Report is 70 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff            @@
##             main    #3784    +/-   ##
========================================
  Coverage   89.24%   89.25%            
========================================
  Files         907      909     +2     
  Lines      104818   105541   +723     
========================================
+ Hits        93548    94202   +654     
- Misses      11270    11339    +69     
Flag Coverage Δ
builders 29.16% <0.00%> (+0.01%) ⬆️
default 85.76% <0.00%> (?)
expensive 35.70% <0.00%> (?)
linux 86.72% <100.00%> (-2.29%) ⬇️
linux_other 86.72% <100.00%> (+0.03%) ⬆️
osx 82.87% <0.00%> (+0.05%) ⬆️
win 84.97% <100.00%> (+0.03%) ⬆️
win_other 84.97% <100.00%> (+0.03%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 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.

Copy link
Contributor

@mrmundt mrmundt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh this is gross

@jsiirola jsiirola merged commit 3bbacd2 into Pyomo:main Nov 13, 2025
59 of 65 checks passed
@jsiirola jsiirola deleted the pytest-9.0.1-workaround branch November 13, 2025 16:25
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.

3 participants