[TIP] Test discovery for unittest

Douglas Philips dgou at mac.com
Mon Apr 6 17:01:02 PDT 2009

On or about 2009 Apr 6, at 6:26 PM, John Arbash Meinel indited:
> Auto-discovery will have similar problems. If you fail to import, do  
> you
> raise an error, or do you just skip that file? (Skipping things  
> silently
> can easily lead to tests that don't run when you expected them to.)

I want the regression run to stop if there are any errors.
I don't mind if the loader continues past the first one so that it can  
report as many import errors in one run as possible, but I absolutely  
want that to abort the regression run. We have a custom loader that  
used to be forgiving, but the fact is once you have more than a  
hundred tests, you don't see the warning for all the other output.  
Printing out a summary of the load errors and aborting the regression  
run will get everyone's attention.

One could argue that missing tests due to import errors are just  
missing tests and as such should be caught by the post-regression down- 
stream results processors, but I would much prefer to have the option  
to abort running any tests (for various reasons including being able  
to detect test code problems as early as possible).


More information about the testing-in-python mailing list