如何使用"python setup.py nosetests"指定要运行的测试

A. *_*vis 6 python nose

看,我的setup.py:

https://github.com/mongodb/motor/blob/master/setup.py

...和setup.cfg:

https://github.com/mongodb/motor/blob/master/setup.cfg

我希望能够运行一个套件,例如:

python setup.py nosetests test.test_motor_ssl
Run Code Online (Sandbox Code Playgroud)

但我得到"无效的命令名称'test.test_motor_ssl'".有了这个,另一方面:

python setup.py nosetests --tests test.test_motor_ssl
Run Code Online (Sandbox Code Playgroud)

... nosetests在我的项目中运行每个测试.如何在setup.py中运行测试时如何运行测试的子集?

小智 3

显然这是鼻子 1.2.1 中的一个已知错误,他们已经在 master 分支中进行了修复。您可以等待下一个版本,也可以nosetests直接使用该命令。

来源: https: //github.com/nose-devs/nose/issues/556

  • 只是在 1.3.X 版本中还没有修复 (2认同)