You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
first of all thanks a lot for this amazing project, I really love working with it. :)
Describe the situation
I'm trying to reuse my fixtures / step definitions as often as possible to make my test code concise and clean. That's why I rely a lot on the feature of using multiple BDD decorators for one function.
In one situation, which is for my case not really uncommon, I want to use a function like this:
@given("Do some stuff", target_fixture="stuff")
@when(parsers.parse("you did a \"{action_type}\"", target_fixture="stuff")
defdo_some_stuff(action_type: str=None):
...
The argument (action_type) for the second decorator (when) will never be correctly filled, but always uses the fallback value None
Expected Behaviour
The BDD argument should be correctly inserted as an argument for the function, and the "fallback" value of the function should only be used if there's no input for this argument.
Hey there,
first of all thanks a lot for this amazing project, I really love working with it. :)
Describe the situation
I'm trying to reuse my fixtures / step definitions as often as possible to make my test code concise and clean. That's why I rely a lot on the feature of using multiple BDD decorators for one function.
In one situation, which is for my case not really uncommon, I want to use a function like this:
The argument (action_type) for the second decorator (when) will never be correctly filled, but always uses the fallback value
None
Expected Behaviour
The BDD argument should be correctly inserted as an argument for the function, and the "fallback" value of the function should only be used if there's no input for this argument.
Test system:
💻: MacOS Ventura
🐍: 3.10
Pytest Version: 7.2.2
Pytest_BDD Version: 6.1.1
I also tested it with a fresh install of pytest and pytest_bdd
Thanks a lot in advance
The text was updated successfully, but these errors were encountered: