A modest suggestion for unittest.py 
Author Message
 A modest suggestion for unittest.py

Would it be okay with everyone if there was some option added to the
TestProgram (invoked by default when using unittest.main()) so that it does
not perform a sys.exit() when it is done running tests?  This would make it
easier to run some tests and then drop through to the interpreter with -i.
Better yet, it would be nice if the interpreter mode had direct access to
the test cases (where the tests are exposed to globals()) for easier
probing.

Rich



Wed, 04 Feb 2004 00:54:29 GMT  
 A modest suggestion for unittest.py

Quote:

> Would it be okay with everyone if there was some option added to the
> TestProgram (invoked by default when using unittest.main()) so that it does
> not perform a sys.exit() when it is done running tests?  This would make it
> easier to run some tests and then drop through to the interpreter with -i.

I'm not sure this would work, but couldn't you do something like this
somewhere in the code before the tests are executed?

Quote:
>>> import sys
>>> def do_not_exit():

...   print 'sys.exit() caught and ignored.'
...

Quote:
>>> sys.exit = do_not_exit

--
----------------------
Peter Hansen, P.Eng.



Wed, 04 Feb 2004 12:40:32 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Notes on unittest.py

2. unittest.py: what is TestResult.__repr__ ?

3. A modest PEP0238 suggestion

4. Another cgi.py question and/or suggestion

5. cgi.py suggestion

6. Suggestion: UnixOptionParser class in optparse.py

7. trying to run boa: problem with stc.py / stc_.py / stc_c.py

8. unittest: how to specify which suites to run with unittest.main()?

9. Deleting rexec.py and Bastion.py

10. Need help Translating Python unittest to Ruby Test::Unit

11. The various UnitTest frameworks.

12. site.py, sitecustomize.py and unicode errors

 

 
Powered by phpBB® Forum Software