Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple lines with tags override previous lines #194

Open
The-Compiler opened this issue Aug 19, 2016 · 1 comment · May be fixed by #706
Open

Multiple lines with tags override previous lines #194

The-Compiler opened this issue Aug 19, 2016 · 1 comment · May be fixed by #706

Comments

@The-Compiler
Copy link
Member

When I have foo.feature:

Feature: Test

    @tag1
    @tag2
    Scenario: Test
        When foo
        Then bar

and foo.py:

from pytest_bdd import scenarios, when, then

@when('foo')
def when_foo():
    pass

@then('bar')
def then_bar():
    pass

scenarios('foo.feature')

I'd expect the scenario to be tagged with both tag1 and tag2 - however, the second tag line just overrides the first:

$ py.test foo.py -ktag1
=============== test session starts ===============
platform linux -- Python 3.5.2, pytest-2.9.2, py-1.4.31, pluggy-0.3.1
rootdir: /home/florian/bdd, inifile: 
plugins: bdd-2.17.0
collected 1 items 

========= 1 tests deselected by '-ktag1' ==========
========== 1 deselected in 0.02 seconds ===========
$ py.test foo.py -ktag2
=============== test session starts ===============
platform linux -- Python 3.5.2, pytest-2.9.2, py-1.4.31, pluggy-0.3.1
rootdir: /home/florian/bdd, inifile: 
plugins: bdd-2.17.0
collected 1 items 

foo.py .

============ 1 passed in 0.02 seconds =============
@arthuRHD
Copy link

write both tags on the same line

@jsa34 jsa34 linked a pull request Sep 26, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants