Skip to content

Commit 62e60c6

Browse files
committed
we also need to catch fixture dependencies errors
1 parent 143dabc commit 62e60c6

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

pytest_bdd/scenario.py

+9-10
Original file line numberDiff line numberDiff line change
@@ -73,19 +73,18 @@ def _execute_step_function(
7373
# Get the step argument values.
7474
converters = context.converters
7575
kwargs = {}
76-
77-
for arg, value in context.parser.parse_arguments(step.name).items():
78-
if arg in converters:
79-
value = converters[arg](value)
80-
kwargs[arg] = value
81-
8276
args = get_args(context.step_func)
83-
kwargs = {arg: kwargs[arg] if arg in kwargs else request.getfixturevalue(arg) for arg in args}
84-
kw["step_func_args"] = kwargs
85-
86-
request.config.hook.pytest_bdd_before_step_call(**kw)
8777

8878
try:
79+
for arg, value in context.parser.parse_arguments(step.name).items():
80+
if arg in converters:
81+
value = converters[arg](value)
82+
kwargs[arg] = value
83+
84+
kwargs = {arg: kwargs[arg] if arg in kwargs else request.getfixturevalue(arg) for arg in args}
85+
kw["step_func_args"] = kwargs
86+
87+
request.config.hook.pytest_bdd_before_step_call(**kw)
8988
# Execute the step as if it was a pytest fixture, so that we can allow "yield" statements in it
9089
return_value = call_fixture_func(fixturefunc=context.step_func, request=request, kwargs=kwargs)
9190
except Exception as exception:

0 commit comments

Comments
 (0)