On Thu, Nov 13, 2008 at 11:01 AM, Alan Baljeu <[EMAIL PROTECTED]> wrote:
> When I call unittest.main(), it invokes sys.exit().  I would like to run 
> tests without exiting.  How can I?

There's probably a better way that stops it from trying to exit in the
first place, but here's a quick kludge:

try:
    unittest.main()
except SystemExit:
    pass

sys.exit() does its job by noting the return code and then raising the
SystemExit exception, which you are free to catch.

Cheers,
Chris
-- 
Follow the path of the Iguana...
http://rebertia.com

>
>
>  Alan Baljeu
>
>
>      __________________________________________________________________
> Instant Messaging, free SMS, sharing photos and more... Try the new Yahoo! 
> Canada Messenger at http://ca.beta.messenger.yahoo.com/
> --
> http://mail.python.org/mailman/listinfo/python-list
>
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to