Pycharm没有显示覆盖范围,但显示了代码文件中的覆盖范围
我正在尝试在Pycharm的“覆盖面板”中查看我们的测试的代码覆盖范围。一切都可以正常工作,文件中出现了代码覆盖范围,但是我似乎无法在覆盖面板中获得任何统计信息。它保持空。我已经尝试删除.Coverage文件,重新启动Pycharm,添加-COV
和- NO-COV
到测试配置的参数。统计数据不显示的原因是什么?
I'm trying to see the code coverage of our test in the coverage panel from pycharm. Everything works as it should, with code coverage appearing in the files, but I can't seem to get any statistics in the coverage panel. It stays empty. I've tried removing the .coverage files, restarting pycharm, adding --cov
and --no-cov
to the parameters of the test configuration. What can be the reason the statistics don't show up?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
pytest-cov
但coverage.py
。coverage.py
可以通过Pycharm设置(设置>构建,执行,部署> Coverage)进行部分配置。大多数设置必须在.coveragerc
文件中设置。coverage.py
以忽略我的tests
目录。覆盖范围视图
(问题中图像中右侧的窗格)未显示tests的统计信息
,但无论如何显示了“测试”中文件的行命中在编辑中。因此,
程序
可以成为“省略”。另一个想法:用代码的目录的名称包含一些不可见的字符,导致错误阻止显示统计信息。
pytest-cov
butcoverage.py
.coverage.py
can be partly configured by PyCharm settings (Settings>Build, Execution, Deployment>Coverage). Most settings must be set in the.coveragerc
file.coverage.py
up to ignore mytests
directory.Coverage View
(the pane on the right on the image in the question) does not show the statistics fortests
but anyway the line hit for the files in 'tests' are shown in editor.So
Program
can become "omit" for example.Another idea: the name of the directory with the code contains some not visible characters that causes a bug preventing the statistics from showing.