@@ -24,6 +24,7 @@ def test_step_trace(testdir):
24
24
feature-tag
25
25
scenario-passing-tag
26
26
scenario-failing-tag
27
+ scenario-skipping-tag
27
28
"""
28
29
),
29
30
)
@@ -32,7 +33,7 @@ def test_step_trace(testdir):
32
33
test = textwrap .dedent (
33
34
"""
34
35
@feature-tag
35
- Feature: One passing scenario, one failing scenario
36
+ Feature: One passing scenario, one failing scenario, one skipping scenario
36
37
37
38
@scenario-passing-tag
38
39
Scenario: Passing
@@ -44,6 +45,12 @@ def test_step_trace(testdir):
44
45
Given a passing step
45
46
And a failing step
46
47
48
+ @scenario-skipping-tag
49
+ Scenario: Skipping
50
+ Given a passing step
51
+ And a skipping step
52
+ And a passing step
53
+
47
54
Scenario Outline: Outlined
48
55
Given there are <start> cucumbers
49
56
When I eat <eat> cucumbers
@@ -75,6 +82,10 @@ def some_other_passing_step():
75
82
def a_failing_step():
76
83
raise Exception('Error')
77
84
85
+ @given('a skipping step')
86
+ def a_skipping_step():
87
+ pytest.skip()
88
+
78
89
@given('there are <start> cucumbers')
79
90
def start_cucumbers(start):
80
91
assert isinstance(start, int)
@@ -106,7 +117,7 @@ def should_have_left_cucumbers(start_cucumbers, start, eat, left):
106
117
"description" : u"" ,
107
118
"filename" : feature .strpath ,
108
119
"line_number" : 2 ,
109
- "name" : u"One passing scenario, one failing scenario" ,
120
+ "name" : u"One passing scenario, one failing scenario, one skipping scenario " ,
110
121
"rel_filename" : relpath ,
111
122
"tags" : [u"feature-tag" ],
112
123
},
@@ -145,7 +156,7 @@ def should_have_left_cucumbers(start_cucumbers, start, eat, left):
145
156
"description" : u"" ,
146
157
"filename" : feature .strpath ,
147
158
"line_number" : 2 ,
148
- "name" : u"One passing scenario, one failing scenario" ,
159
+ "name" : u"One passing scenario, one failing scenario, one skipping scenario " ,
149
160
"rel_filename" : relpath ,
150
161
"tags" : [u"feature-tag" ],
151
162
},
@@ -177,24 +188,71 @@ def should_have_left_cucumbers(start_cucumbers, start, eat, left):
177
188
}
178
189
assert report == expected
179
190
191
+ report = result .matchreport ("test_skipping" , when = "call" ).scenario
192
+ expected = {
193
+ "feature" : {
194
+ "description" : u"" ,
195
+ "filename" : feature .strpath ,
196
+ "line_number" : 2 ,
197
+ "name" : u"One passing scenario, one failing scenario, one skipping scenario" ,
198
+ "rel_filename" : relpath ,
199
+ "tags" : [u"feature-tag" ],
200
+ },
201
+ "line_number" : 15 ,
202
+ "name" : u"Skipping" ,
203
+ "steps" : [
204
+ {
205
+ "duration" : OfType (float ),
206
+ "failed" : False ,
207
+ "keyword" : "Given" ,
208
+ "line_number" : 16 ,
209
+ "name" : u"a passing step" ,
210
+ "skipped" : False ,
211
+ "type" : "given" ,
212
+ },
213
+ {
214
+ "duration" : OfType (float ),
215
+ "failed" : False ,
216
+ "keyword" : "And" ,
217
+ "line_number" : 17 ,
218
+ "name" : u"a skipping step" ,
219
+ "skipped" : True ,
220
+ "type" : "given" ,
221
+ },
222
+ {
223
+ "duration" : OfType (float ),
224
+ "failed" : False ,
225
+ "keyword" : "And" ,
226
+ "line_number" : 18 ,
227
+ "name" : u"a passing step" ,
228
+ "skipped" : True ,
229
+ "type" : "given" ,
230
+ },
231
+ ],
232
+ "tags" : [u"scenario-skipping-tag" ],
233
+ "examples" : [],
234
+ "example_kwargs" : {},
235
+ }
236
+ assert report == expected
237
+
180
238
report = result .matchreport ("test_outlined[12-5.0-7]" , when = "call" ).scenario
181
239
expected = {
182
240
"feature" : {
183
241
"description" : u"" ,
184
242
"filename" : feature .strpath ,
185
243
"line_number" : 2 ,
186
- "name" : u"One passing scenario, one failing scenario" ,
244
+ "name" : u"One passing scenario, one failing scenario, one skipping scenario " ,
187
245
"rel_filename" : relpath ,
188
246
"tags" : [u"feature-tag" ],
189
247
},
190
- "line_number" : 14 ,
248
+ "line_number" : 20 ,
191
249
"name" : u"Outlined" ,
192
250
"steps" : [
193
251
{
194
252
"duration" : OfType (float ),
195
253
"failed" : False ,
196
254
"keyword" : "Given" ,
197
- "line_number" : 15 ,
255
+ "line_number" : 21 ,
198
256
"name" : u"there are <start> cucumbers" ,
199
257
"skipped" : False ,
200
258
"type" : "given" ,
@@ -203,7 +261,7 @@ def should_have_left_cucumbers(start_cucumbers, start, eat, left):
203
261
"duration" : OfType (float ),
204
262
"failed" : False ,
205
263
"keyword" : "When" ,
206
- "line_number" : 16 ,
264
+ "line_number" : 22 ,
207
265
"name" : u"I eat <eat> cucumbers" ,
208
266
"skipped" : False ,
209
267
"type" : "when" ,
@@ -212,7 +270,7 @@ def should_have_left_cucumbers(start_cucumbers, start, eat, left):
212
270
"duration" : OfType (float ),
213
271
"failed" : False ,
214
272
"keyword" : "Then" ,
215
- "line_number" : 17 ,
273
+ "line_number" : 23 ,
216
274
"name" : u"I should have <left> cucumbers" ,
217
275
"skipped" : False ,
218
276
"type" : "then" ,
@@ -221,7 +279,7 @@ def should_have_left_cucumbers(start_cucumbers, start, eat, left):
221
279
"tags" : [],
222
280
"examples" : [
223
281
{
224
- "line_number" : 19 ,
282
+ "line_number" : 25 ,
225
283
"name" : None ,
226
284
"row_index" : 0 ,
227
285
"rows" : [["start" , "eat" , "left" ], [[12 , 5.0 , "7" ], [5 , 4.0 , "1" ]]],
@@ -237,18 +295,18 @@ def should_have_left_cucumbers(start_cucumbers, start, eat, left):
237
295
"description" : u"" ,
238
296
"filename" : feature .strpath ,
239
297
"line_number" : 2 ,
240
- "name" : u"One passing scenario, one failing scenario" ,
298
+ "name" : u"One passing scenario, one failing scenario, one skipping scenario " ,
241
299
"rel_filename" : relpath ,
242
300
"tags" : [u"feature-tag" ],
243
301
},
244
- "line_number" : 14 ,
302
+ "line_number" : 20 ,
245
303
"name" : u"Outlined" ,
246
304
"steps" : [
247
305
{
248
306
"duration" : OfType (float ),
249
307
"failed" : False ,
250
308
"keyword" : "Given" ,
251
- "line_number" : 15 ,
309
+ "line_number" : 21 ,
252
310
"name" : u"there are <start> cucumbers" ,
253
311
"skipped" : False ,
254
312
"type" : "given" ,
@@ -257,7 +315,7 @@ def should_have_left_cucumbers(start_cucumbers, start, eat, left):
257
315
"duration" : OfType (float ),
258
316
"failed" : False ,
259
317
"keyword" : "When" ,
260
- "line_number" : 16 ,
318
+ "line_number" : 22 ,
261
319
"name" : u"I eat <eat> cucumbers" ,
262
320
"skipped" : False ,
263
321
"type" : "when" ,
@@ -266,7 +324,7 @@ def should_have_left_cucumbers(start_cucumbers, start, eat, left):
266
324
"duration" : OfType (float ),
267
325
"failed" : False ,
268
326
"keyword" : "Then" ,
269
- "line_number" : 17 ,
327
+ "line_number" : 23 ,
270
328
"name" : u"I should have <left> cucumbers" ,
271
329
"skipped" : False ,
272
330
"type" : "then" ,
@@ -275,7 +333,7 @@ def should_have_left_cucumbers(start_cucumbers, start, eat, left):
275
333
"tags" : [],
276
334
"examples" : [
277
335
{
278
- "line_number" : 19 ,
336
+ "line_number" : 25 ,
279
337
"name" : None ,
280
338
"row_index" : 1 ,
281
339
"rows" : [["start" , "eat" , "left" ], [[12 , 5.0 , "7" ], [5 , 4.0 , "1" ]]],
0 commit comments