我们正在使用 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模板网!