diff --git a/src/pytest_bdd/scenario.py b/src/pytest_bdd/scenario.py index bc0d723e..36607986 100644 --- a/src/pytest_bdd/scenario.py +++ b/src/pytest_bdd/scenario.py @@ -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