@@ -40,13 +40,13 @@ def test_steps_with_docstrings(pytester):
40
40
41
41
@given("a step has a docstring")
42
42
def _(docstring):
43
- given_docstring = docstring.strip()
43
+ given_docstring = docstring
44
44
dump_obj(given_docstring)
45
45
46
46
47
47
@when("a step provides a docstring with lower indentation")
48
48
def _(docstring):
49
- when_docstring = docstring.strip()
49
+ when_docstring = docstring
50
50
dump_obj(when_docstring)
51
51
52
52
@@ -57,7 +57,7 @@ def _():
57
57
58
58
@then("this step has a greater indentation")
59
59
def _(docstring):
60
- then_docstring = docstring.strip()
60
+ then_docstring = docstring
61
61
dump_obj(then_docstring)
62
62
"""
63
63
)
@@ -66,11 +66,9 @@ def _(docstring):
66
66
pytester .makepyfile (
67
67
textwrap .dedent (
68
68
"""\
69
- from pytest_bdd import scenario
69
+ from pytest_bdd import scenarios
70
70
71
- @scenario("docstring.feature", "Step with plain docstring as multiline step")
72
- def test_docstring():
73
- pass
71
+ scenarios("docstring.feature")
74
72
"""
75
73
)
76
74
)
@@ -127,11 +125,9 @@ def _():
127
125
pytester .makepyfile (
128
126
textwrap .dedent (
129
127
"""\
130
- from pytest_bdd import scenario
128
+ from pytest_bdd import scenarios
131
129
132
- @scenario("missing_docstring.feature", "Docstring is missing for a step")
133
- def test_docstring():
134
- pass
130
+ scenarios("missing_docstring.feature")
135
131
"""
136
132
)
137
133
)
@@ -140,10 +136,10 @@ def test_docstring():
140
136
result .stdout .fnmatch_lines (["*fixture 'docstring' not found*" ])
141
137
142
138
143
- def test_steps_with_docstring_missing_argument_in_step_def (pytester ):
139
+ def test_docstring_argument_in_step_impl_is_optional (pytester ):
144
140
pytester .makefile (
145
141
".feature" ,
146
- missing_docstring_arg = textwrap .dedent (
142
+ optional_docstring_arg = textwrap .dedent (
147
143
'''\
148
144
Feature: Missing docstring
149
145
@@ -189,11 +185,9 @@ def _():
189
185
pytester .makepyfile (
190
186
textwrap .dedent (
191
187
"""\
192
- from pytest_bdd import scenario
188
+ from pytest_bdd import scenarios
193
189
194
- @scenario("missing_docstring_arg.feature", "Docstring arg is missing for a step definition")
195
- def test_docstring():
196
- pass
190
+ scenarios("optional_docstring_arg.feature")
197
191
"""
198
192
)
199
193
)
0 commit comments