我想将 x 从一个步骤更改为另一个步骤,而不添加另一个功能
Feature: Calculator
Scenario Outline: simple sum
Given the x is 1
And the x is <x>
Examples:
| x |
| 5 |
from pytest_bdd import given, when, then, scenario, parsers
import logging
info = logging.getLogger('test').info
@scenario("test.feature", "simple sum")
def test_outlined():
pass
@given(parsers.parse("the x is {x}"))
@given("the x is <x>")
def f(request, x):
info("x=%s" % x)
输出:
2021-08-31 14:23:30 INFO x=1
2021-08-31 14:23:30 INFO x=1
想要的输出:
2021-08-31 14:23:30 INFO x=1
2021-08-31 14:23:30 INFO x=5
非常感谢,请帮忙