#2669: Test system cannot differentiate between missing tests.py and import
error
in tests.py
------------------------------+---------------------------------------------
Reporter: russellm | Owner: russellm
Type: defect | Status: new
Priority: normal | Milestone:
Component: Unit test system | Version: SVN
Severity: normal | Keywords:
------------------------------+---------------------------------------------
Ned Batchelder reports that because the test runner uses speculative
imports to find tests that may or may not exist, ImportErrors in the tests
themselves are usually cloaked, and are hard to debug.
One suggested fix is to modify django/test/simple.py, line 41, to this:
{{{
except ImportError, exc:
# No tests.py file for application, or some other import error.
if str(exc) != 'No module named %s' % TEST_MODULE:
# It's something other than a missing tests module, probably
a real
# error, so show the user.
import traceback
traceback.print_exc()
}}}
This is less than ideal; testing error strings is fragile and prone to
locale problems. Testing for the existence of tests.py is also unreliable;
tests may be a directory module.
--
Ticket URL: <http://code.djangoproject.com/ticket/2669>
Django <http://code.djangoproject.org/>
The web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates
-~----------~----~----~----~------~----~------~--~---