Bryce Hendrix | 8 May 2006 18:55

Re: skipping unit tests

grogers wrote:
>>
>> Which brings me to my other request: if possible, put your imports in 
>> the test methods, or at least setup method. Doing so will allow for 
>> the unittest framework to parse the file and let us know how many 
>> tests failed, rather than just saying the entire file was bad.
>>
> Since we should not have any tests that fail, I don't see the need for 
> changing our coding standard....
>
> If you haven't read the coding standard lately, please do so.  It's in 
> https://svn.enthought.com/enthought/browser/trunk/docs/coding_standard.py
While I agree that tests should not fail, we know this is never the case.

Moving imports into the test methods allows for each test to actually be 
executed, which provides much more emphasis on big breaks. For example, 
if a file contains 10 methods, if an import fails at the global scope, 
the test framework doesn't know how many methods there were, so it 
reports 0/1 passed. If the failed import is done within the methods, you 
could get anything from 0/10 to 9/10.

Bryce


Gmane