Skip to content

Commit

Permalink
refactor: Explicit exception 'raise ... from None' (B904)
Browse files Browse the repository at this point in the history
  • Loading branch information
kieran-ryan committed Jan 1, 2025
1 parent ae75a69 commit 1b83238
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pytest_bdd/scenario.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,9 +385,9 @@ def scenario(
scenario = feature.scenarios[scenario_name]
except KeyError:
feature_name = feature.name or "[Empty]"
raise exceptions.ScenarioNotFound( # noqa: B904
raise exceptions.ScenarioNotFound(
f'Scenario "{scenario_name}" in feature "{feature_name}" in {feature.filename} is not found.'
)
) from None

return _get_scenario_decorator(
feature=feature, feature_name=feature_name, templated_scenario=scenario, scenario_name=scenario_name
Expand Down

0 comments on commit 1b83238

Please sign in to comment.