我进行了验收测试和单元测试/django.测试单元测试。我有
TEST_RUNNER = 'django_behave.runner.DjangoBehaveTestSuiteRunner'
在settings.py
中。我有多个单元测试文件:
myapp/tests
__init.py__ # empty
tests_a.py
tests_b.py
我想运行一个单元测试文件。(没有一个特写,我知道怎么做。)
python manage.py test myapp.tests.tests_a
我明白了
Ignoring label with dot in: myapp.tests.tests_a
然后tests_a.py
运行。太好了!只有我想运行的测试运行了。但是试跑者在说什么呢?我还没有找到另一个调用来运行我想要的测试,但不会发出警告。这是怎么回事?你知道吗
Django 1.10.2,Django 0.1.5。你知道吗
django-behave
允许这样传递应用程序名称:执行此操作时,它将加载属于每个应用程序的功能。您可以在^{} 中看到该代码。我在这里给出的链接指向撰写此答案时发布的最新版本。在该模块中,您将发现:
当代码遇到一个带有点的标签时,它会假定它不是一个应用程序名,并跳过它。所以你可以:
而且
some.module.name
不会导致django-behave
尝试加载名为some.module.name
的应用程序并失败。你知道吗该代码的最新版本(尚未发布)不再发布关于忽略标签的通知。你知道吗
相关问题 更多 >
编程相关推荐