Skip to content

Commit bf8c17d

Browse files
committed
Add test compatibility for pytest-bdd>=6
1 parent 2a3f334 commit bf8c17d

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

allure-pytest-bdd/features/outline.feature

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,17 @@ Feature: Scenario outline
1717
"""
1818
from pytest_bdd import scenario
1919
from pytest_bdd import given, then, when
20+
from pytest_bdd.parsers import cfparse
2021
21-
@given("<first> step")
22+
@given(cfparse("{first} step"))
2223
def given_step(first):
2324
pass
2425
2526
@when("do nothing")
2627
def nope_step():
2728
pass
2829
29-
@then("step with <second> param")
30+
@then(cfparse("step with {second} param"))
3031
def then_step(second):
3132
pass
3233
@@ -37,15 +38,11 @@ Feature: Scenario outline
3738
When run pytest-bdd with allure
3839

3940
Then allure report has result for "Outline example" scenario
40-
Then this scenario has parameter "first" with value "Alpha"
41-
Then this scenario has parameter "second" with value "1"
42-
Then this scenario contains "Given <Alpha> step" step
43-
Then this scenario contains "Then step with <1> param" step
41+
Then this scenario contains "Given Alpha step" step
42+
Then this scenario contains "Then step with 1 param" step
4443

4544
Then allure report has result for "Outline example" scenario
46-
Then this scenario has parameter "first" with value "Bravo"
47-
Then this scenario has parameter "second" with value "2"
48-
Then this scenario contains "Given <Bravo> step" step
49-
Then this scenario contains "Then step with <2> param" step
45+
Then this scenario contains "Given Bravo step" step
46+
Then this scenario contains "Then step with 2 param" step
5047

5148

allure-pytest-bdd/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
install_requires = [
2222
"pytest>=4.5.0",
23-
"pytest-bdd>=3.0.0",
23+
"pytest-bdd>=5.0.0",
2424
"six>=1.9.0",
2525
]
2626

allure-pytest-bdd/test/conftest.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
from .steps import * # noqa F401 F403
88
from pytest_bdd import given, when, parsers
99

10+
pytest_plugins = ["pytester"]
11+
1012

1113
@contextmanager
1214
def fake_logger(path, logger):

0 commit comments

Comments
 (0)