django doctests not being run

流过昼夜 提交于 2019-12-05 12:44:25

The verbosity message is telling you your models.py file is being ignored because it's executable. This means you need to do:

chmod -x models.py

Unless you have a specific reason for that file to be set as executable, in which case adding --exe to your NOSE_ARGS should be sufficient.

jcomeau_ictx

I realize that the OP specified 1.3, but since this answer comes up in a search for 'django doctests do not run' here's my answer for 1.6 from one of the answers in Django doctests in views.py. in this version of Django doctests are not automatically included, so in $APP/tests.py you need:

import doctest
def load_tests(loader, tests, ignore):
    tests.addTests(doctest.DocTestSuite())
    return tests

[this only finds the doctests in tests.py itself; to have it run doctests on other modules, say myapp/models.py, you need to from myapp import models and tests.addTests(doctest.DocTestSuite(models))]

nosetests --verbosity 1 season --with-doctest

Usage: manage.py test [options] [appname ...]

Perhaps you just need to move season to then end.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!