通过行为上下文共享数据

时间:2019-03-29 22:52:56

标签: python-behave

我们如何在行为的步骤定义之间共享数据?我的问题:

@when('I post a request with {transaction_id}'
def step_impl(context, transaction_id)
    context.order = '23434433'

我需要将context.order的值传递给另一个步骤定义。我如何获得该价值?我的尝试:

@then('i check the DB')
def step_implementation(context)
    # how can I access the context.order from here?

当前,我收到Attribute error : 'context' object has no attribute 'order'

感谢您的帮助。

0 个答案:

没有答案