如何使用beh编写python中的简单组件测试

2024-03-29 14:36:10 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图学习如何在python中使用behave编写组件测试 如果你能分享一些视频链接或文章,这将是充分的帮助。你知道吗

从简单的例子开始,加两个数,求和?我们如何为这些编写组件测试。你知道吗


Tags: 视频链接文章组件例子behave
1条回答
网友
1楼 · 发布于 2024-03-29 14:36:10

the doc有示例和教程:

from behave import *

@given('we have behave installed')
def step_impl(context):
    pass

@when('we implement a test')
def step_impl(context):
    assert True is not False

@then('behave will test it for us!')
def step_impl(context):
    assert context.failed is False

This website有一个behave的视频教程列表。你知道吗

相关问题 更多 >