Open The-Compiler opened 7 years ago
When I have foo.feature:
foo.feature
Feature: Test @tag1 @tag2 Scenario: Test When foo Then bar
and foo.py:
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:
tag1
tag2
$ 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 =============
write both tags on the same line
When I have
foo.feature
:and
foo.py
:I'd expect the scenario to be tagged with both
tag1
andtag2
- however, the second tag line just overrides the first: