coverage.py Inforterror:没有名为Coverage.cmdline的模块
我定期使用覆盖范围。py模块,但是每次我不使用它超过一年,我都会忘记如何使用它,并且需要大量时间来弄清楚如何使用它,因为发布了的说明https://coverage.readthedocs.io/en/6.3.2/
不对现实无关,也不起作用。我上次写下说明时,尽管如此,我仍然无法正常工作。我过去使用过的说明是:
coverage-3.8 run -m [module without .py] [args]
coverage-3.8 html -i
现在,经过一些反复试验后,我必须使用:
Python -M覆盖范围运行[带.py的模块] [args] [args] [args
]
coverage html -i
我得到的
File "/usr/local/bin/coverage", line 7, in <module>
from coverage.cmdline import main
ImportError: No module named coverage.cmdline
我过去已经能够生成HTML报告,它一直是简单的命令行函数,但我不知道为什么现在不起作用。
I use the coverage.py module periodically but every time I don't use it for more than a year I forget how to use it and it takes enormous amounts of time to figure out how to use it since the instructions posted at https://coverage.readthedocs.io/en/6.3.2/
have no bearing on reality and do not work. The last time I wrote the instructions down but inspite of that I still cannot get it to work. The instructions that I used to use and that worked were:
coverage-3.8 run -m [module without .py] [args]
coverage-3.8 html -i
Now after some trial and error I have to use:
python -m coverage run [module with .py] [args]
That works but now when I try to generate the html report with
coverage html -i
I get
File "/usr/local/bin/coverage", line 7, in <module>
from coverage.cmdline import main
ImportError: No module named coverage.cmdline
I have been able to generate the html report in the past and it has always been a simply command line function but I don't know why it doesn't work now.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
实际上,
是有效的命令,将返回所需的结果。我决定不删除该帖子,以防其他人在coverage.py上有类似的问题。
Actually,
are valid commands and will return the desired results. I decided not to delete the post just in case anyone else has similar problems with coverage.py.