#7693: Different import paths can impact whether doctests are run or not.
------------------------------+---------------------------------------------
 Reporter:  davenaff          |       Owner:  nobody    
   Status:  new               |   Milestone:            
Component:  Unit test system  |     Version:  SVN       
 Keywords:                    |       Stage:  Unreviewed
Has_patch:  1                 |  
------------------------------+---------------------------------------------
 My directory structure looks like this:

 /appname/models.py
 /appname/utils/__init__.py (empty)
 /appname/utils/util1.py

 in util1.py, I do this:
 from appname.models import Class1, Class2

 This import causes the doctests in models.py to not run. If I remove
 util1.py entirely, the doctests in models.py are run.

 I patched this by editing line 895 in
 root/django/trunk/django/test/_doctest.py
 I changed it from:
             return module.__name__ == object.__module__
 to
             return module.__name__.find(object.__module__) >=0

 In my example above:
 module.__name__ = 'appname.models' and
 object.__module__ = 'projectname.appname.models'

 I'm selecting 'has patch' and attaching the file, but frankly am not sure
 if this is the right way to handle this or not.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/7693>
Django Code <http://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