> Sent: 2006-11-09; To: comp.lang.python
>
> Can doctest ... be persuaded to exit after a catastroph[e]...?
> ...
> sys.exit() doesn't do what I mean:
> it raises SystemExit ... [and doesn't exit]
> ...
> doctest.REPORT_ONLY_FIRST_FAILURE doesn't do what I mean
> [it filters stdout but doesn't exit
(((I thought I had sent this reply already, Google says No.)))
> > Can I somehow tell doctest that it's time to quit?
> > ... doctest redefines ... SystemExit ...
>
> Hit Ctrl-C. Or raise a KeyboardInterrupt:
Yes! Thank you!!! I see now,
Doctest exactly reverses the python -i experience:
[EMAIL PROTECTED] wrote:
> Can I somehow tell doctest that it's time to quit?
Hit Ctrl-C. Or raise a KeyboardInterrupt:
import sys
class ExitDoctest(KeyboardInterrupt):
pass
def f(what):
"""
>>> f("alpha")
'alpha'
>>> f("e")
'e'
>>> f("x")
'x'
>>> f("X")
> From: http://docs.python.org/lib/doctest-soapbox.html ...
> Regression testing is best confined to dedicated objects or files ...
Can I somehow tell doctest that it's time to quit?
I ask because not all doctest examples are created equal. Some
failures are catastrophic, making all subsequent f