【发布时间】:2008-12-14 16:52:50
【问题描述】:
目前我的代码按以下树形结构组织:
src/
module1.py
module2.py
test_module1.py
test_module2.py
subpackage1/
__init__.py
moduleA.py
moduleB.py
test_moduleA.py
test_moduleB.py
module*.py 文件包含源代码,test_module*.py 包含相关模块的TestCases。
使用以下命令,我可以运行包含在单个文件中的测试,例如:
$ cd src
$ nosetests test_filesystem.py
..................
----------------------------------------------------------------------
Ran 18 tests in 0.390s
OK
如何运行所有测试?我尝试使用nosetests -m 'test_.*',但它不起作用。
$cd src
$ nosetests -m 'test_.*'
----------------------------------------------------------------------
Ran 0 tests in 0.000s
OK
谢谢
【问题讨论】:
标签: python unit-testing python-nose