unit testing failure makes no sense

Peter Otten __peter__ at web.de
Wed Aug 30 18:13:47 EDT 2006


listservs at mac.com wrote:

> I have some unit testing code in one of my modules that appears to
> run without an error, but the unit test fails anyhow. Have a look at
> the output below -- the TestResult seems to have no errors and no
> failures, yet I get a system exit.

sys.exit(0) is just a normal way to exit a program, and it is implemented as
'raise SystemExit'. You seem to be running your test from within ipython
which probably catches SystemExit exceptions to prevent you from losing
state. Try running your test from the shell and all should be OK.

Peter



More information about the Python-list mailing list