Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Apr 21, 2023
1 parent 0959385 commit d7522fc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/pytest_bdd/scenario.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion tests/steps/test_given.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,4 @@ def _(foo, bar):
)
)
result = pytester.runpytest()
result.assert_outcomes(passed=1)
result.assert_outcomes(passed=1)

0 comments on commit d7522fc

Please sign in to comment.