python - 在测试套件运行期间 Hook python的覆盖范围?

标签 python unit-testing testing code-coverage qa

我有一个在bash中运行的测试套件,它下面使用了许多python脚本。我想在测试套件中查看涵盖了多少python脚本。

我已经看过python-coverage了,但这仅适用于完全用python编写的套件。有谁知道我可以连接到python的任何工具,提供脚本列表,并且在套件完成后看到覆盖率结果吗?

TIA

最佳答案

您可以在Python启动时自动启动coverage.py。关于Measuring subprocesses with coverage.py的页面介绍了操作方法。

关于python - 在测试套件运行期间 Hook python的覆盖范围?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31566383/

相关文章:

javascript - ReactJS 和 enzyme : Matching elements contents to string

python - Redis Error 8 connecting localhost :6379. nodename nor servname provided, or not known

python - 查找一个序列并删除之前的条目

python - 将 Python Dict 写入 InfluxDB?

android - 尝试使用 PowerMockito stub android Activity 类抛出 RuntimeException "Stub!"

testing - 当我们在现有测试用例中间添加一个新测试用例时,测试框架如何表现?

python - Pyqt5 查找 QlistWidgetItem 的行

asp.net-mvc - HttpContext 中需要什么来允许 FormsAuthentication.SignOut() 执行?

javascript - Jasmine toHaveBeenCalledWith 部分匹配

r - 自动查找软件性能测试中的错误?