[TIP] unit2 fails when code in testing calls sys.exit()

Michael Foord fuzzyman at voidspace.org.uk
Wed Aug 11 16:37:44 PDT 2010

On 11/08/2010 21:21, Jorge Vargas wrote:
> Hello,
> I think I have discovered a bug if the code you are testing calls
> sys.exit() mainly because it discovered an unrecoverable error,
> currently the unit2 --discover (for non-tip users) fails and just
> exits. I have reported this at
> http://code.google.com/p/unittest-ext/issues/detail?id=28 and proposed
> a solution.

Hmm.... unittest(2) could catch BaseException instead of Exception. I 
would have to special-case KeyBoardInterrupt (and OutOfMemory?) but at 
least SystemExit would be caught like any other exception during a test run.


> _______________________________________________
> testing-in-python mailing list
> testing-in-python at lists.idyll.org
> http://lists.idyll.org/listinfo/testing-in-python


READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (”BOGUS AGREEMENTS”) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer.

More information about the testing-in-python mailing list