Eclipse + Pydev如何获得单元测试覆盖率?

编程入门 行业动态 更新时间:2024-10-18 01:30:13
本文介绍了Eclipse + Pydev如何获得单元测试覆盖率?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我知道Eclipse + PyDev有一个选项 Run As => 3 Python Coverage 。但是所有报告都是:

在0.001s中进行6次测试

确定

它没有说明代码覆盖。如何在Pydev中获取代码覆盖率报告?

解决方案

  • 运行Python Coverage
  • 窗口>显示视图>代码覆盖结果视图
  • 选择执行文件的目录
  • 双击文件列表中执行的文件
  • 统计信息现在在右边,代码视图中未执行的行被标记为红色
    • 其实这是一个非常好的功能,以前不了解它:)

      I know Eclipse + PyDev has an option Run As => 3 Python Coverage. But all it reports is:

      Ran 6 tests in 0.001s

      OK

      And it says nothing about code coverage. How to get a code coverage report in Pydev?

      解决方案

      • Run a file with "Python Coverage"
      • Window > Show View > Code Coverage Results View
      • Select the directory in which the executed file is
      • Double-click on the executed file in the file list
      • Statistics are now at the right, not executed lines are marked red in the code view

      Actually this is a really nice feature, didn't know about it before :)

更多推荐

Eclipse + Pydev如何获得单元测试覆盖率?

本文发布于:2023-11-16 01:42:48,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1599859.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:覆盖率   如何获得   单元测试   Eclipse   Pydev

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!