File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ Unreleased
1212- Multiline steps must now always use triple-quotes for the additional lines.
1313- All feature files must now use the keyword `Feature: ` to be considered valid.
1414- Tags can no longer have spaces (e.g. "@tag one" and "@tag two" are no longer valid).
15+ - Tags can now be on multiple lines (stacked)
1516
16177.3.0
1718----------
Original file line number Diff line number Diff line change 22
33import textwrap
44
5- import pytest
6-
75
86def test_tags_selector (pytester ):
97 """Test tests selection by tags."""
@@ -191,3 +189,40 @@ def _():
191189 strict_option = "--strict-markers"
192190 result = pytester .runpytest_subprocess (strict_option )
193191 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