在所有子目录中运行鼻子测试 [英] run nosetests in all subdirectories
本文介绍了在所有子目录中运行鼻子测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我可以使用 nosetests
在 workflow
文件夹中运行测试:
I can run tests in workflow
folder with nosetests
:
workflow maks$ nosetests
..........
----------------------------------------------------------------------
Ran 10 tests in 0.093s
OK
我的测试存在于 test
文件夹中:
my tests live in test
folder:
workflow maks$ ls
__pycache__ iterations.py test
data iterationsClass.py testData
env iterationsClass.pyc
但是当我移动到父目录时:
But when I move to parent dir:
(py3env)Makss-Mac:workflow maks$ cd ..
它找不到测试.
(py3env)Makss-Mac:Packages maks$ nosetests
----------------------------------------------------------------------
Ran 0 tests in 0.005s
OK
那么如何在所有子目录中进行nosetest搜索测试?
So how to make nosetest search tests in all subdirectories?
推荐答案
如果你把 __init__.py
放在你的 workflow
文件夹中,把它变成一个模块,nose 应该是能够找到您的测试.
If you make your workflow
folder a module by placing __init__.py
in it, nose should be able to find your tests.
这篇关于在所有子目录中运行鼻子测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文