[issue10611] sys.exit() in a test causes a test run to die

Ray.Allen report at bugs.python.org
Fri Dec 10 07:29:05 CET 2010


Ray.Allen <ysj.ray at gmail.com> added the comment:

Agreed. I think the "except Exception" in TestCase.run() should be "except BaseException", since BaseException could catch Exception, SystemExit, GeneratorExit, KeyboardInterrupt. The KeyboardInterrupt should be caught first. The remaining three is exactly what is needed.

Here is a patch I worked, with unittest.

----------
keywords: +patch
nosy: +ysj.ray
Added file: http://bugs.python.org/file19994/issue_10611.diff

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue10611>
_______________________________________


More information about the Python-bugs-list mailing list