1
所以我有一个名为“test”的目录,里面有更多的目录,其中有很多测试。如何添加这样的模式,以便鼻子测试确定这些测试并运行它?在python中添加更多测试模式到nosetests?
所以我有一个名为“test”的目录,里面有更多的目录,其中有很多测试。如何添加这样的模式,以便鼻子测试确定这些测试并运行它?在python中添加更多测试模式到nosetests?
您可以运行nosetests
与选项-i
--include
:
-i REGEX, --include=REGEX
This regular expression will be applied to files,
directories, function names, and class names for a
chance to include additional tests that do not match
TESTMATCH. Specify this option multiple times to add
more regular expressions [NOSE_INCLUDE]
我们可以添加一个插件还是什么?许多人使用相同的代码,所以我想要一个解决方案,以便我们只需要从命令行运行“nosetests”。当然,我可以要求每个人都添加别名,但我希望是否有更好的解决方案。 – Rajat 2012-08-10 20:23:33
是的,你可以使用[code](https://github.com/nose-devs/nose/blob/master/nose/plugins/allmodules.py)其中一个[bundled modules](http://以nose.readthedocs.org/en/latest/plugins/allmodules.html)为例。 – 2012-08-10 20:26:51