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

Test tags on multiple lines now handled correctly #706

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 37 additions & 2 deletions tests/feature/test_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

import textwrap

import pytest


def test_tags_selector(pytester):
"""Test tests selection by tags."""
Expand Down Expand Up @@ -191,3 +189,40 @@ def _():
strict_option = "--strict-markers"
result = pytester.runpytest_subprocess(strict_option)
result.stdout.fnmatch_lines(["*= 2 passed * =*"])


def test_multiline_tags(pytester):
pytester.makefile(
".feature",
test="""
Feature: Scenario with multiple tags over multiple lines

@tag1
@tag2
Scenario: Tags
Given I have a foo

Scenario: Second
Given I have a baz
""",
)
pytester.makepyfile(
"""
from pytest_bdd import given, scenarios

@given('I have a foo')
def _():
pass

@given('I have a baz')
def _():
pass

scenarios('test.feature')
"""
)
result = pytester.runpytest("-m", "tag1", "-vv")
result.assert_outcomes(passed=1, deselected=1)

result = pytester.runpytest("-m", "tag2", "-vv")
result.assert_outcomes(passed=1, deselected=1)
Loading