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测试框架的测试覆盖工具


- YouTube API v3 返回截断的观看记录 2022-01-01
- 如何使用PYSPARK从Spark获得批次行 2022-01-01
- CTR 中的 AES 如何用于 Python 和 PyCrypto? 2022-01-01
- 我如何透明地重定向一个Python导入? 2022-01-01
- ";find_element_by_name(';name';)";和&QOOT;FIND_ELEMENT(BY NAME,';NAME';)";之间有什么区别? 2022-01-01
- 我如何卸载 PyTorch? 2022-01-01
- 计算测试数量的Python单元测试 2022-01-01
- 使用 Cython 将 Python 链接到共享库 2022-01-01
- 使用公司代理使Python3.x Slack(松弛客户端) 2022-01-01
- 检查具有纬度和经度的地理点是否在 shapefile 中 2022-01-01