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

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,190
Members
46,736
Latest member
zacharyharris

Latest Threads

Top