diff --git a/src/pytest_bdd/scenario.py b/src/pytest_bdd/scenario.py index 864346ce..1941b9cd 100644 --- a/src/pytest_bdd/scenario.py +++ b/src/pytest_bdd/scenario.py @@ -162,9 +162,11 @@ def _execute_step_function( raise if context.target_fixture is not None: - target_fixture_tokens = [token for token in context.target_fixture.split(',') if token] + target_fixture_tokens = [token for token in context.target_fixture.split(",") if token] return_values = (return_value,) if not isinstance(return_value, tuple) else return_value - assert len(target_fixture_tokens) == len(return_values), f"Return value count: {len(return_values)} are not matching target_fixture count: {len(target_fixture_tokens)}" + assert len(target_fixture_tokens) == len( + return_values + ), f"Return value count: {len(return_values)} are not matching target_fixture count: {len(target_fixture_tokens)}" for token, value in zip(target_fixture_tokens, return_values): inject_fixture(request, token, value) diff --git a/tests/steps/test_given.py b/tests/steps/test_given.py index caa890b9..ee78a222 100644 --- a/tests/steps/test_given.py +++ b/tests/steps/test_given.py @@ -76,4 +76,4 @@ def _(foo, bar): ) ) result = pytester.runpytest() - result.assert_outcomes(passed=1) \ No newline at end of file + result.assert_outcomes(passed=1)