如何省略使用 python 覆盖率库?
我想省略某些特定目录中的一些模块:eggs 和 bin
coverage -r -i --omit=/usr/lib/,/usr/share/,eggs,bin
Name Stmts Exec Cover
-----------------------------------------------------------------------------------------
bin/test 5 5 100%
eggs/BeautifulSoup-3.0.7a-py2.6.egg/BeautifulSoup 1008 463 45%
eggs/Django-1.0.2_final-py2.6.egg/django/__init__ 15 12 80%
我也尝试了几种变体,但没有运气:
coverage -r -i --omit=/usr/lib/,/usr/share/,`pwd`/eggs,`pwd`/bin
or
coverage -r -i --omit=/usr/lib/,/usr/share/,django,BeautifulSoup
or
coverage -r -i --omit=/usr/lib/,/usr/share/,<absolute path>/eggs
如果有人有一个让这个工作正常的提示,那就太好了。
I would like to omit some module that are in some particular directory : eggs and bin
coverage -r -i --omit=/usr/lib/,/usr/share/,eggs,bin
Name Stmts Exec Cover
-----------------------------------------------------------------------------------------
bin/test 5 5 100%
eggs/BeautifulSoup-3.0.7a-py2.6.egg/BeautifulSoup 1008 463 45%
eggs/Django-1.0.2_final-py2.6.egg/django/__init__ 15 12 80%
I have also try several variant of this without luck :
coverage -r -i --omit=/usr/lib/,/usr/share/,`pwd`/eggs,`pwd`/bin
or
coverage -r -i --omit=/usr/lib/,/usr/share/,django,BeautifulSoup
or
coverage -r -i --omit=/usr/lib/,/usr/share/,<absolute path>/eggs
It would be great if someone has a tip to get this working.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
说实话,我认为这可能只是coverage.py 中的一个错误。我很快就会调查一下。
更新:好的,我已经修复了这个错误(我希望),并发布了新的套件:覆盖范围。 py 3.2b2。如果仍然不好,请告诉我。
To tell you the truth, I think this might just be a bug in coverage.py. I'll look into it soon.
UPDATED: OK, I've fixed this bug (I hope), and posted new kits: Coverage.py 3.2b2. Please let me know if it still is no good.