@@ -25,6 +25,7 @@ def test_step_trace(pytester):
25
25
feature-tag
26
26
scenario-passing-tag
27
27
scenario-failing-tag
28
+ scenario-skipping-tag
28
29
"""
29
30
),
30
31
)
@@ -33,7 +34,7 @@ def test_step_trace(pytester):
33
34
test = textwrap .dedent (
34
35
"""
35
36
@feature-tag
36
- Feature: One passing scenario, one failing scenario
37
+ Feature: One passing scenario, one failing scenario, one skipping scenario
37
38
38
39
@scenario-passing-tag
39
40
Scenario: Passing
@@ -45,6 +46,12 @@ def test_step_trace(pytester):
45
46
Given a passing step
46
47
And a failing step
47
48
49
+ @scenario-skipping-tag
50
+ Scenario: Skipping
51
+ Given a passing step
52
+ And a skipping step
53
+ And a passing step
54
+
48
55
Scenario Outline: Outlined
49
56
Given there are <start> cucumbers
50
57
When I eat <eat> cucumbers
@@ -76,6 +83,10 @@ def _():
76
83
def _():
77
84
raise Exception('Error')
78
85
86
+ @given('a skipping step')
87
+ def _():
88
+ pytest.skip()
89
+
79
90
@given(parsers.parse('there are {start:d} cucumbers'), target_fixture="cucumbers")
80
91
def _(start):
81
92
assert isinstance(start, int)
@@ -106,7 +117,7 @@ def _(cucumbers, left):
106
117
"description" : "" ,
107
118
"filename" : str (feature ),
108
119
"line_number" : 2 ,
109
- "name" : "One passing scenario, one failing scenario" ,
120
+ "name" : "One passing scenario, one failing scenario, one skipping scenario " ,
110
121
"rel_filename" : str (relpath ),
111
122
"tags" : ["feature-tag" ],
112
123
},
@@ -143,7 +154,7 @@ def _(cucumbers, left):
143
154
"description" : "" ,
144
155
"filename" : str (feature ),
145
156
"line_number" : 2 ,
146
- "name" : "One passing scenario, one failing scenario" ,
157
+ "name" : "One passing scenario, one failing scenario, one skipping scenario " ,
147
158
"rel_filename" : str (relpath ),
148
159
"tags" : ["feature-tag" ],
149
160
},
@@ -173,24 +184,69 @@ def _(cucumbers, left):
173
184
}
174
185
assert report == expected
175
186
187
+ report = result .matchreport ("test_skipping" , when = "call" ).scenario
188
+ expected = {
189
+ "feature" : {
190
+ "description" : "" ,
191
+ "filename" : str (feature ),
192
+ "line_number" : 2 ,
193
+ "name" : "One passing scenario, one failing scenario, one skipping scenario" ,
194
+ "rel_filename" : str (relpath ),
195
+ "tags" : ["feature-tag" ],
196
+ },
197
+ "line_number" : 15 ,
198
+ "name" : "Skipping" ,
199
+ "steps" : [
200
+ {
201
+ "duration" : OfType (float ),
202
+ "failed" : False ,
203
+ "keyword" : "Given" ,
204
+ "line_number" : 16 ,
205
+ "name" : "a passing step" ,
206
+ "skipped" : False ,
207
+ "type" : "given" ,
208
+ },
209
+ {
210
+ "duration" : OfType (float ),
211
+ "failed" : False ,
212
+ "keyword" : "And" ,
213
+ "line_number" : 17 ,
214
+ "name" : "a skipping step" ,
215
+ "skipped" : True ,
216
+ "type" : "given" ,
217
+ },
218
+ {
219
+ "duration" : OfType (float ),
220
+ "failed" : False ,
221
+ "keyword" : "And" ,
222
+ "line_number" : 18 ,
223
+ "name" : "a passing step" ,
224
+ "skipped" : True ,
225
+ "type" : "given" ,
226
+ },
227
+ ],
228
+ "tags" : ["scenario-skipping-tag" ],
229
+ }
230
+ assert report == expected
231
+
176
232
report = result .matchreport ("test_outlined[12-5-7]" , when = "call" ).scenario
177
233
expected = {
178
234
"feature" : {
179
235
"description" : "" ,
180
236
"filename" : str (feature ),
181
237
"line_number" : 2 ,
182
- "name" : "One passing scenario, one failing scenario" ,
238
+ "name" : "One passing scenario, one failing scenario, one skipping scenario " ,
183
239
"rel_filename" : str (relpath ),
184
240
"tags" : ["feature-tag" ],
185
241
},
186
- "line_number" : 14 ,
242
+ "line_number" : 20 ,
187
243
"name" : "Outlined" ,
188
244
"steps" : [
189
245
{
190
246
"duration" : OfType (float ),
191
247
"failed" : False ,
192
248
"keyword" : "Given" ,
193
- "line_number" : 15 ,
249
+ "line_number" : 21 ,
194
250
"name" : "there are 12 cucumbers" ,
195
251
"skipped" : False ,
196
252
"type" : "given" ,
@@ -199,7 +255,7 @@ def _(cucumbers, left):
199
255
"duration" : OfType (float ),
200
256
"failed" : False ,
201
257
"keyword" : "When" ,
202
- "line_number" : 16 ,
258
+ "line_number" : 22 ,
203
259
"name" : "I eat 5 cucumbers" ,
204
260
"skipped" : False ,
205
261
"type" : "when" ,
@@ -208,7 +264,7 @@ def _(cucumbers, left):
208
264
"duration" : OfType (float ),
209
265
"failed" : False ,
210
266
"keyword" : "Then" ,
211
- "line_number" : 17 ,
267
+ "line_number" : 23 ,
212
268
"name" : "I should have 7 cucumbers" ,
213
269
"skipped" : False ,
214
270
"type" : "then" ,
@@ -224,18 +280,18 @@ def _(cucumbers, left):
224
280
"description" : "" ,
225
281
"filename" : str (feature ),
226
282
"line_number" : 2 ,
227
- "name" : "One passing scenario, one failing scenario" ,
283
+ "name" : "One passing scenario, one failing scenario, one skipping scenario " ,
228
284
"rel_filename" : str (relpath ),
229
285
"tags" : ["feature-tag" ],
230
286
},
231
- "line_number" : 14 ,
287
+ "line_number" : 20 ,
232
288
"name" : "Outlined" ,
233
289
"steps" : [
234
290
{
235
291
"duration" : OfType (float ),
236
292
"failed" : False ,
237
293
"keyword" : "Given" ,
238
- "line_number" : 15 ,
294
+ "line_number" : 21 ,
239
295
"name" : "there are 5 cucumbers" ,
240
296
"skipped" : False ,
241
297
"type" : "given" ,
@@ -244,7 +300,7 @@ def _(cucumbers, left):
244
300
"duration" : OfType (float ),
245
301
"failed" : False ,
246
302
"keyword" : "When" ,
247
- "line_number" : 16 ,
303
+ "line_number" : 22 ,
248
304
"name" : "I eat 4 cucumbers" ,
249
305
"skipped" : False ,
250
306
"type" : "when" ,
@@ -253,7 +309,7 @@ def _(cucumbers, left):
253
309
"duration" : OfType (float ),
254
310
"failed" : False ,
255
311
"keyword" : "Then" ,
256
- "line_number" : 17 ,
312
+ "line_number" : 23 ,
257
313
"name" : "I should have 1 cucumbers" ,
258
314
"skipped" : False ,
259
315
"type" : "then" ,
0 commit comments