问题描述
我们正在使用 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测试框架的测试覆盖工具的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!


大气响应式网络建站服务公司织梦模板
高端大气html5设计公司网站源码
织梦dede网页模板下载素材销售下载站平台(带会员中心带筛选)
财税代理公司注册代理记账网站织梦模板(带手机端)
成人高考自考在职研究生教育机构网站源码(带手机端)
高端HTML5响应式企业集团通用类网站织梦模板(自适应手机端)