Skip to content

Commit 96039fd

Browse files
committed
Use the skip hook and plugin if the step is skipped
- trigger the skip hook if a step is skipped
1 parent a013a11 commit 96039fd

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pytest_bdd/scenario.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
except ImportError:
2323
from _pytest import python as pytest_fixtures
2424

25+
from _pytest.outcomes import Skipped
26+
2527
from . import exceptions
2628
from .feature import Feature, force_unicode, get_features
2729
from .steps import get_caller_module, get_step_fixture_name, inject_fixture
@@ -117,6 +119,9 @@ def _execute_step_function(request, scenario, step, step_func):
117119
except Exception as exception:
118120
request.config.hook.pytest_bdd_step_error(exception=exception, **kw)
119121
raise
122+
except Skipped as exception:
123+
request.config.hook.pytest_bdd_step_skip(exception=exception, **kw)
124+
raise
120125

121126

122127
def _execute_scenario(feature, scenario, request, encoding):

0 commit comments

Comments
 (0)