File tree 2 files changed +0
-43
lines changed
2 files changed +0
-43
lines changed Original file line number Diff line number Diff line change 23
23
exceptions .FeatureError ,
24
24
"Multiple features are not allowed in a single feature file." ,
25
25
),
26
- (
27
- re .compile (r"expected:.*got '(?:Given|When|Then|And|But).*'" ),
28
- exceptions .FeatureError ,
29
- "Step definition outside of a Scenario or a Background." ,
30
- ),
31
26
(
32
27
re .compile (r"expected:.*got 'Background.*'" ),
33
28
exceptions .BackgroundError ,
Original file line number Diff line number Diff line change @@ -34,44 +34,6 @@ def test_multiple_features_error(pytester):
34
34
result .stdout .fnmatch_lines (["*FeatureError: Multiple features are not allowed in a single feature file.*" ])
35
35
36
36
37
- def test_step_outside_scenario_or_background_error (pytester ):
38
- """Test step outside of a Scenario or Background."""
39
- features = pytester .mkdir ("features" )
40
- features .joinpath ("test.feature" ).write_text (
41
- textwrap .dedent (
42
- """
43
- Feature: Invalid Feature
44
- # Step not inside a scenario or background
45
- Given a step that is not inside a scenario or background
46
-
47
- Scenario: A valid scenario
48
- Given a step inside a scenario
49
-
50
- """
51
- ),
52
- encoding = "utf-8" ,
53
- )
54
-
55
- pytester .makepyfile (
56
- textwrap .dedent (
57
- """
58
- from pytest_bdd import scenarios, given
59
-
60
- @given("a step inside a scenario")
61
- def step_inside_scenario():
62
- pass
63
-
64
- scenarios('features')
65
- """
66
- )
67
- )
68
-
69
- result = pytester .runpytest ()
70
-
71
- # Expect the FeatureError for the step outside of scenario or background
72
- result .stdout .fnmatch_lines (["*FeatureError: Step definition outside of a Scenario or a Background.*" ])
73
-
74
-
75
37
def test_multiple_backgrounds_error (pytester ):
76
38
"""Test multiple backgrounds in a single feature."""
77
39
features = pytester .mkdir ("features" )
You can’t perform that action at this time.
0 commit comments