![](/img/trans.png)
[英]How can I organise my unit tests to run in a particular order in Python Nosetests
[英]How do I measure the execution time of python unit tests with nosetests?
有沒有辦法計算由nosetests運行的單個Python測試的執行時間?
您可以嘗試在此處發布的鼻子插件: https : //github.com/mahmoudimus/nose-timer (或通過pip / PyPi獲得)。 您還可以使用內置插件--with-profile
進行更嚴格的分析。
或者:
python -m cProfile -o profile.out `which nosetests` .
可以使用例如runsnakerun查看輸出,這使得在視覺上非常明顯地表現出性能問題。 (例如,它可能是許多測試間接調用的常用方法)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.