Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
youtux committed Mar 11, 2022
1 parent ad86cfe commit 163a015
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 52 deletions.
59 changes: 7 additions & 52 deletions tests/feature/test_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ def test_tags_selector(testdir):
@feature_tag_1 @feature_tag_2
Feature: Tags
@scenario_tag_01 @scenario_tag_02
Scenario: Tags
Given I have a bar
@scenario_tag_10 @scenario_tag_20
Scenario: Tags 2
Given I have a bar
@scenario_tag_01 @scenario_tag_02
Scenario: Tags
Given I have a bar
@scenario_tag_10 @scenario_tag_20
Scenario: Tags 2
Given I have a bar
""",
)
Expand Down Expand Up @@ -162,51 +162,6 @@ def i_have_bar():
result.stdout.fnmatch_lines(["*= 1 skipped, 1 xpassed * =*"])


def test_tag_with_spaces(testdir):
testdir.makefile(
".ini",
pytest=textwrap.dedent(
"""
[pytest]
markers =
test with spaces
"""
),
)
testdir.makeconftest(
"""
import pytest
@pytest.hookimpl(tryfirst=True)
def pytest_bdd_apply_tag(tag, function):
assert tag == 'test with spaces'
"""
)
testdir.makefile(
".feature",
test="""
Feature: Tag with spaces
@test with spaces
Scenario: Tags
Given I have a bar
""",
)
testdir.makepyfile(
"""
from pytest_bdd import given, scenarios
@given('I have a bar')
def i_have_bar():
return 'bar'
scenarios('test.feature')
"""
)
result = testdir.runpytest_subprocess()
result.stdout.fnmatch_lines(["*= 1 passed * =*"])


def test_at_in_scenario(testdir):
testdir.makefile(
".feature",
Expand Down
1 change: 1 addition & 0 deletions tests/test_new_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# - Comments are now only allowed in their own lines.
# - "Feature:" line is always required.
# - Other changes. Check the modifications to the tests.
# - Tags can only be "valid" identifiers, e.g. no spaces.


def test_feature():
Expand Down

0 comments on commit 163a015

Please sign in to comment.