2011-03-30 45 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,這使得它在視覺上很明顯,其中的性能問題。 (例如,它可能在很多測試中間接調用常用的方法)

相關問題