Opened 10 years ago

Closed 10 years ago

#7693 closed (invalid)

Different import paths can impact whether doctests are run or not.

Reported by: Dave Naffziger Owned by: nobody
Component: Testing framework Version: master
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


My directory structure looks like this:

/appname/utils/ (empty)

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

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

I patched this by editing line 895 in root/django/trunk/django/test/
I changed it from:

return == object.module


return >=0

In my example above: = '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.

Attachments (1) (101.0 KB) - added by Dave Naffziger 10 years ago.

Download all attachments as: .zip

Change History (2)

Changed 10 years ago by Dave Naffziger

Attachment: added

comment:1 Changed 10 years ago by Russell Keith-Magee

Resolution: invalid
Status: newclosed

There must be something else going on here - you haven't mentioned anything that imports, so that code won't be imported, and therefore wont be executed. I don't deny you're seeing a problem, but either isn't the cause, or there is something else going on that your instructions don't cover.

Also - regarding your proposed solution - is a copy of the Python version, provided as a workaround for bugs in older Python versions. Patches proposing fixes to are almost certainly not the right solution to any problem - if they are the solution, they should be submitted upstream to Python itself.

Note: See TracTickets for help on using tickets.
Back to Top