Skip to content

Commit 4427f19

Browse files
committed
refactor: Explicit exception 'raise ... from None' (B904)
https://docs.astral.sh/ruff/rules/raise-without-from-inside-except/
1 parent 59c638c commit 4427f19

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/pytest_bdd/scenario.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -384,9 +384,9 @@ def scenario(
384384
scenario = feature.scenarios[scenario_name]
385385
except KeyError:
386386
feature_name = feature.name or "[Empty]"
387-
raise exceptions.ScenarioNotFound( # noqa: B904
387+
raise exceptions.ScenarioNotFound(
388388
f'Scenario "{scenario_name}" in feature "{feature_name}" in {feature.filename} is not found.'
389-
)
389+
) from None
390390

391391
return _get_scenario_decorator(
392392
feature=feature, feature_name=feature_name, templated_scenario=scenario, scenario_name=scenario_name

0 commit comments

Comments
 (0)