Skip to content

Commit 1b83238

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

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: src/pytest_bdd/scenario.py

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

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

0 commit comments

Comments
 (0)