sys.exit and '-i'

  • Thread starter Ulrich Eckhardt
  • Start date
U

Ulrich Eckhardt

Hi!

The unittest module will invoke sys.exit() after running the tests in order
to signal success or failure. However, I sometimes don't want to exit the
interpreter but instead e.g. inspect some state or just keep the window
open. Normally, using '-i' as commandline argument works, but not in the
case here.

My questions are:
1. Is that a bug? After all, an explicit request on the commandline was
ignored. Is it perhaps simply wrong how the unittest module handles
error/success signalling?
2. I can catch the SystemExit exception and ignore it, but that doesn't
actually help, because then I get a normal exit even in case of failures.
Of course, I could pass that value to sys.exit(), but then I'd be back at
the start.

Any suggestions?

Uli
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,162
Latest member
GertrudeMa
Top