【发布时间】:2013-01-29 22:24:11
【问题描述】:
如何在测试包下的特定模块中运行所有TestCase 类的测试?
在一个 Django 项目中,我在 tests/ 下拆分了 tests.py
每个文件(模块)都有几个 TestCase 类,每个类都有几个测试方法。
init.py 导入它们中的每一个。
我已经知道我可以做到这些:
-
运行所有测试:
./manage.py test myapp -
或者运行特定的TestCase:
./manage.py test myapp.OneOfManyTestCase -
或者从 TestCase 类运行非常具体的测试方法:
./manage.py test myapp.OneOfManyTestCase.test_some_small_method
但是,我不知道如何从特定模块运行每个 TestCases。
比如说,OneOfManyTestCase 类来自tests/lot_of_test.py,还有其他测试用例。
Django 似乎并不关心带有 TestCases 的模块。
如何在lot_of_test 中运行所有的测试用例?
【问题讨论】:
标签: django django-testing