Skip to content

Commit ed581b5

Browse files
committed
test: update codegen test expectations for scenarios() shortcut
The template now emits a single scenarios('foo.feature') call instead of one @Scenario(...) decorator per scenario, so the expected output strings in test_generate, test_generate_with_quotes, and test_unicode_characters need to match.
1 parent 750a007 commit ed581b5

1 file changed

Lines changed: 6 additions & 15 deletions

File tree

tests/scripts/test_generate.py

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,12 @@ def test_generate(pytester, monkeypatch, capsys):
4242
4343
from pytest_bdd import (
4444
given,
45-
scenario,
45+
scenarios,
4646
then,
4747
when,
4848
)
4949
50-
51-
@scenario('scripts/generate.feature', 'Given and when using the same fixture should not evaluate it twice')
52-
def test_given_and_when_using_the_same_fixture_should_not_evaluate_it_twice():
53-
"""Given and when using the same fixture should not evaluate it twice."""
50+
scenarios('scripts/generate.feature')
5451
5552
5653
@given('1 have a fixture (appends 1 to a list) in reuse syntax')
@@ -108,15 +105,12 @@ def test_generate_with_quotes(pytester):
108105
109106
from pytest_bdd import (
110107
given,
111-
scenario,
108+
scenarios,
112109
then,
113110
when,
114111
)
115112
116-
117-
@scenario('generate_with_quotes.feature', 'A step definition with quotes should be escaped as needed')
118-
def test_a_step_definition_with_quotes_should_be_escaped_as_needed():
119-
"""A step definition with quotes should be escaped as needed."""
113+
scenarios('generate_with_quotes.feature')
120114
121115
122116
@given('I have a fixture with "double" quotes')
@@ -184,15 +178,12 @@ def test_unicode_characters(pytester, monkeypatch):
184178
185179
from pytest_bdd import (
186180
given,
187-
scenario,
181+
scenarios,
188182
then,
189183
when,
190184
)
191185
192-
193-
@scenario('unicode_characters.feature', 'Calculating the circumference of a circle')
194-
def test_calculating_the_circumference_of_a_circle():
195-
"""Calculating the circumference of a circle."""
186+
scenarios('unicode_characters.feature')
196187
197188
198189
@given('We have a circle')

0 commit comments

Comments
 (0)