File tree Expand file tree Collapse file tree 2 files changed +38
-2
lines changed Expand file tree Collapse file tree 2 files changed +38
-2
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ Unreleased
12
12
- Multiline steps must now always use triple-quotes for the additional lines.
13
13
- All feature files must now use the keyword `Feature: ` to be considered valid.
14
14
- Tags can no longer have spaces (e.g. "@tag one" "@tag two" are no longer valid).
15
+ - Tags can now be on multiple lines (stacked)
15
16
16
17
7.3.0
17
18
----------
Original file line number Diff line number Diff line change 2
2
3
3
import textwrap
4
4
5
- import pytest
6
-
7
5
8
6
def test_tags_selector (pytester ):
9
7
"""Test tests selection by tags."""
@@ -191,3 +189,40 @@ def _():
191
189
strict_option = "--strict-markers"
192
190
result = pytester .runpytest_subprocess (strict_option )
193
191
result .stdout .fnmatch_lines (["*= 2 passed * =*" ])
192
+
193
+
194
+ def test_multiline_tags (pytester ):
195
+ pytester .makefile (
196
+ ".feature" ,
197
+ test = """
198
+ Feature: Scenario with tags over multiple lines
199
+
200
+ @tag1
201
+ @tag2
202
+ Scenario: Tags
203
+ Given I have a foo
204
+
205
+ Scenario: Second
206
+ Given I have a baz
207
+ """ ,
208
+ )
209
+ pytester .makepyfile (
210
+ """
211
+ from pytest_bdd import given, scenarios
212
+
213
+ @given('I have a foo')
214
+ def _():
215
+ pass
216
+
217
+ @given('I have a baz')
218
+ def _():
219
+ pass
220
+
221
+ scenarios('test.feature')
222
+ """
223
+ )
224
+ result = pytester .runpytest ("-m" , "tag1" , "-vv" )
225
+ result .assert_outcomes (passed = 1 , deselected = 1 )
226
+
227
+ result = pytester .runpytest ("-m" , "tag2" , "-vv" )
228
+ result .assert_outcomes (passed = 1 , deselected = 1 )
You can’t perform that action at this time.
0 commit comments