Repository navigation
Require unittest completion before isolated module success - #2579
Merged
Merged
Conversation
This was referenced Oct 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A unittest
load_testshook can raiseSystemExit(0)before discovery finishes. The isolated runner previously treated that zero process exit as a pass and printedPASS all 2 test modulesin the reproduced two-module fixture, although only the healthy module completed.Require a per-child completion token written only after
unittest.main(..., exit=False)returns a successful result, together with exit status zero. Preserve the original discovery arguments seen throughsys.argv, ordered captured output, independent interpreters, concurrent scheduling and assertion protection. Completed empty and skipped suites retain their existing behavior. This is a guard against premature termination, not hostile test code forging the token.Validation: all eight focused end-to-end tests pass under
-I -O -Bon Windows/Python 3.12.14 and 3.14.5 with workspace TEMP/TMP. Controls include discovery-timeSystemExit(0), execution-timeos._exit(0), exact child argv, valid empty/skipped suites, ordinary failures, concurrency and optimized-parent assertion coverage. The actual before/after witness changes from false PASS/exit0 to identified incomplete module/exit1. No full selected-frontier replay or speed claim.Started from canonical main
0fdd7d82de03e43c9e5a1000dfbcd380d1b687d2, priority revision 4; the prescribed baseline binding check passed. The documentation records the changed verifier-engineering scope and credits the inherited isolated scheduler and assertion guard. No frozen inputs or selected frontier change. Prepared by ywz65 with OpenAI Codex assistance.