Opened 17 years ago

Closed 17 years ago

#5751 closed (duplicate)

manage.py test doesn't run doctests for models split into separate files

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

Description

If models are split into separate files like this:

myapp/models/__init__.py
myapp/models/polls.py
myapp/models/posts.py

the manage.py test command only runs doctests for models defined in myapp/models/__init__.py.

This is true even if I import all the models in __init__.py.

Attachments (1)

doctest_submodules.diff (2.0 KB ) - added by Antti Kaihola 17 years ago.
suggested patch, doctests now found inside multiple model files

Download all attachments as: .zip

Change History (5)

comment:1 by Antti Kaihola, 17 years ago

This seems to be doctest.DocTestFinder's intended behavior, which should be worked around if this is to be fixed.

by Antti Kaihola, 17 years ago

Attachment: doctest_submodules.diff added

suggested patch, doctests now found inside multiple model files

comment:2 by Antti Kaihola, 17 years ago

Has patch: set

Patch above. It would make sense to combine this with the patch for #3310.

I don't know how to write tests for this...

comment:3 by Antti Kaihola, 17 years ago

#3343 has an extremely lightweight alternative patch for this.

comment:4 by Jacob, 17 years ago

Resolution: duplicate
Status: newclosed

Duplicate of #3343.

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