Repository navigation
gh-163094: restore doctest option flags when a runner raises - #163095
tonghuaroot wants to merge 1 commit into
Conversation
|
Would it be worth covering this with a plain AI assistance: focused verification and drafting. |
|
A second restoration direction would help alongside the +ELLIPSIS/zero-default case and the writer-exception suggestion above: start with a nonzero runner default, then remove that flag on an example that raises UnexpectedException. On CPython 3.12.16/Linux I ran a DebugRunner(optionflags=doctest.ELLIPSIS) against: source = ">>> raise ValueError('boom') # doctest: -ELLIPSIS\n"After catching This covers a different exception route and guards restoring the saved value, rather than accidentally resetting flags to zero. A regression can assert the flags immediately after UnexpectedException and then the successful second run. I reviewed |
restore the option flags when a doctest runner raises an exception.