Django

Code

Ticket #5751 (closed: duplicate)

Opened 1 year ago

Last modified 8 months ago

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

Reported by: akaihola Assigned to: nobody
Milestone: Component: Testing framework
Version: SVN Keywords:
Cc: Triage Stage: Unreviewed
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

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

doctest_submodules.diff (2.0 kB) - added by akaihola on 10/14/07 05:06:22.
suggested patch, doctests now found inside multiple model files

Change History

10/14/07 04:32:08 changed by akaihola

  • needs_better_patch changed.
  • needs_tests changed.
  • needs_docs changed.

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

10/14/07 05:06:22 changed by akaihola

  • attachment doctest_submodules.diff added.

suggested patch, doctests now found inside multiple model files

10/14/07 05:17:20 changed by akaihola

  • has_patch set to 1.

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

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

10/17/07 03:12:00 changed by akaihola

#3343 has an extremely lightweight alternative patch for this.

03/02/08 10:02:03 changed by jacob

  • status changed from new to closed.
  • resolution set to duplicate.

Duplicate of #3343.


Add/Change #5751 (manage.py test doesn't run doctests for models split into separate files)




Change Properties
Action