2011-03-30 46 views

回答

25

你可以尝试鼻子插件张贴在这里:https://github.com/mahmoudimus/nose-timer(或通过PIP/PyPI中可用)。您也可以使用内置的插件--with-profile来进行更严格的分析。

+4

nosetests -s --with-的xUnit --with瞩目'找到。 -name “* test.py”' 用法:nosetests [选项] nosetests:错误:没有这样的选项:--with瞩目 – kamal 2011-03-30 03:59:48

+0

人力资源管理,为我工作。你正在运行最新版本的nosetests? (似乎是1.0.0)请参阅这里了解有关性能分析的信息:http://somethingaboutorange.com/mrl/projects/nose/1.0.0/plugins/prof.html – Noah 2011-03-30 14:23:56

+0

yes,nostetsts --version提供了nosetests 1.0版本。 0 – kamal 2011-03-30 21:22:50

8

或者:

python -m cProfile -o profile.out `which nosetests` . 

从可使用,例如,可查看输出,runsnakerun,这使得它在视觉上很明显,其中的性能问题。 (例如,它可能在很多测试中间接调用常用的方法)

相关问题