refactor: Explicit exception 'raise ... from None' (B904)

https://docs.astral.sh/ruff/rules/raise-without-from-inside-except/
This commit is contained in:
Kieran Ryan 2025-01-01 19:59:10 +00:00
parent 59c638c622
commit 4427f19403
1 changed files with 2 additions and 2 deletions

View File

@ -384,9 +384,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