Django

Code

Changeset 5180

Show
Ignore:
Timestamp:
05/10/07 07:07:34 (1 year ago)
Author:
russellm
Message:

Fixed import error handling when application tests are stored in a tests directory, rather than a tests.py file.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/test/simple.py

    r4850 r5180  
    5050        else: 
    5151            # The module exists, so there must be an import error in the  
    52             # test module itself. We don't need the module; close the file 
    53             # handle returned by find_module. 
    54             mod[0].close() 
     52            # test module itself. We don't need the module; so if the 
     53            # module was a single file module (i.e., tests.py), close the file 
     54            # handle returned by find_module. Otherwise, the test module 
     55            # is a directory, and there is nothing to close. 
     56            if mod[0]: 
     57                mod[0].close() 
    5558            raise 
    5659