Python 的 unittest discover 没有找到我的测试!
我一直在用鼻子来发现我的单元测试,它工作正常。从我的项目的顶层,如果我运行,nosetests
我会得到:
Ran 31 tests in 0.390s
现在 Python 2.7 unittest已经发现,我尝试使用
python -m unittest discover
但我明白了
Ran 0 tests in 0.000s
我的目录结构是:
myproj/
reporter/
__init__.py
report.py
[other app modules]
tests/
__init__.py
test-report.py
[other test modules]
您知道为什么 unittest 的发现算法找不到测试吗?
我在 Windows 7 上使用 Python 2.7.1 和鼻子 1.0.0。