Get the step function (context) for the given step. We first figure out what's the step fixture name that we have to inject. Then we let `patch_argumented_step_functions` find out what step definition fixtures can parse the current step, and it will inject them for the step fixture nam
(request: FixtureRequest, step: Step)
| 157 | |
| 158 | |
| 159 | def get_step_function(request: FixtureRequest, step: Step) -> StepFunctionContext | None: |
| 160 | """Get the step function (context) for the given step. |
| 161 | |
| 162 | We first figure out what's the step fixture name that we have to inject. |
| 163 | |
| 164 | Then we let `patch_argumented_step_functions` find out what step definition fixtures can parse the current step, |
| 165 | and it will inject them for the step fixture name. |
| 166 | |
| 167 | Finally, we let request.getfixturevalue(...) fetch the step definition fixture. |
| 168 | """ |
| 169 | __tracebackhide__ = True |
| 170 | bdd_name = get_step_fixture_name(step=step) |
| 171 | |
| 172 | with inject_fixturedefs_for_step(step=step, fixturemanager=request._fixturemanager, node=request.node): |
| 173 | try: |
| 174 | return cast(StepFunctionContext, request.getfixturevalue(bdd_name)) |
| 175 | except pytest.FixtureLookupError: |
| 176 | return None |
| 177 | |
| 178 | |
| 179 | def parse_step_arguments(step: Step, context: StepFunctionContext) -> dict[str, object]: |
no test coverage detected
searching dependent graphs…