#16217: Test runner doesn't report import errors if models is a directory
-----------------------+-----------------------------------
 Reporter:  francis@…  |          Owner:  nobody
     Type:  Bug        |         Status:  new
Milestone:             |      Component:  Testing framework
  Version:  1.3        |       Severity:  Normal
 Keywords:             |   Triage Stage:  Unreviewed
Has patch:  0          |  Easy pickings:  0
    UI/UX:  0          |
-----------------------+-----------------------------------
 I have an application whose models module is a directory with
 models/__init__.py

 That applications tests were mysteriously not being found or run when
 doing "./manage.py test".

 On investigation, I found out this was because there was a syntax error in
 my test code, and that this wasn't reported because of a bug in
 django/test/simple.py

 If import fails, it tries to find whether the test module is there with
 this code:

 {{{
 mod = find_module(TEST_MODULE, [os.path.dirname(app_module.__file__)])
 }}}

 Unfortunately, my app module file was models/__init__.pyc, so that code
 looked for the module within the models directory.

 I don't understand the relationship between __import__ and find_module
 well enough to know what the fix it.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/16217>
Django <https://code.djangoproject.com/>
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?hl=en.

Reply via email to