Fixed import error handling when application tests are stored in a tests directory, rather than a tests.py file.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5180 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
5c68ab6e29
commit
c7db4beb62
|
@ -49,9 +49,12 @@ def build_suite(app_module):
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
# The module exists, so there must be an import error in the
|
# The module exists, so there must be an import error in the
|
||||||
# test module itself. We don't need the module; close the file
|
# test module itself. We don't need the module; so if the
|
||||||
# handle returned by find_module.
|
# module was a single file module (i.e., tests.py), close the file
|
||||||
mod[0].close()
|
# handle returned by find_module. Otherwise, the test module
|
||||||
|
# is a directory, and there is nothing to close.
|
||||||
|
if mod[0]:
|
||||||
|
mod[0].close()
|
||||||
raise
|
raise
|
||||||
|
|
||||||
return suite
|
return suite
|
||||||
|
|
Loading…
Reference in New Issue