Skip to content

Propagate MockedProgram execution assertion - #80

Draft
Mirochill wants to merge 1 commit into
xolox:masterfrom
Mirochill:fix-77-mocked-program-exit
Draft

Mirochill wants to merge 1 commit into
xolox:masterfrom
Mirochill:fix-77-mocked-program-exit

Conversation

@Mirochill

Copy link
Copy Markdown

Summary

  • let MockedProgram.exit propagate the assertion raised when the mocked program was not run
  • keep the context cleanup path intact and add a regression covering cleanup after the assertion

Closes #77

Tests

  • Not run locally

marco8154 added a commit to marco8154/python-humanfriendly-ng that referenced this pull request Nov 26, 2026
…olox#80

Follow-up to the fix from xolox#80: when the block
itself raised an exception (the most common reason for the program not
having run) the AssertionError replaced that exception. The check now
only runs when the block completed.

The changelog names the consequence for other projects: a test that
mocks a program without running it fails from now on.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
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.

return in finally swallows exceptions

1 participant