Test coverage tool for Behave test framework(Behave测试框架的测试覆盖工具)
问题描述
我们正在使用 Behave BDD 工具来自动化 API.是否有任何工具可以使用我们的行为案例提供代码覆盖率?
We are using Behave BDD tool for automating API's. Is there any tool which give code coverage using our behave cases?
我们尝试使用覆盖模块,但它不适用于 Behave.
We tried using coverage module, it didn't work with Behave.
推荐答案
您可以运行任何具有覆盖率的模块以查看代码使用情况.在你的情况下应该接近 coverage run --source='.'-m 行为
You can run any module with coverage to see the code usage.
In your case should be close to coverage run --source='.' -m behave
跟踪 Aceptace/Integration/Behaviour 测试的代码覆盖率很容易给出较高的覆盖率,但可能会让人认为代码经过了适当的测试.
Tracking code coverage for Aceptace/Integration/Behaviour test will give a high coverage number easily but can lead to the idea that the code are properly tested.
这些是为了查看协同工作,而不是跟踪有多少代码被很好地覆盖".
Those are for see things working together, not to track how much code are well 'covered'.
将单元测试和覆盖率捆绑在一起对我来说更有意义.
Tying together unittests and coverages makes more sense to me.
这篇关于Behave测试框架的测试覆盖工具的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Behave测试框架的测试覆盖工具


基础教程推荐
- 使用大型矩阵时禁止 Pycharm 输出中的自动换行符 2022-01-01
- 无法导入 Pytorch [WinError 126] 找不到指定的模块 2022-01-01
- 在同一图形上绘制Bokeh的烛台和音量条 2022-01-01
- 修改列表中的数据帧不起作用 2022-01-01
- 包装空间模型 2022-01-01
- PermissionError: pip 从 8.1.1 升级到 8.1.2 2022-01-01
- PANDA VALUE_COUNTS包含GROUP BY之前的所有值 2022-01-01
- 在Python中从Azure BLOB存储中读取文件 2022-01-01
- Plotly:如何设置绘图图形的样式,使其不显示缺失日期的间隙? 2022-01-01
- 求两个直方图的卷积 2022-01-01