Fix migration guide

This commit is contained in:
Alessio Bogon 2021-09-19 19:08:44 +02:00
parent e2eadb5c8e
commit 030937f625
1 changed files with 3 additions and 1 deletions

View File

@ -1179,7 +1179,7 @@ ordering of the types of the steps.
Migration of your tests from versions 4.x.x
-------------------------------------------
The templated steps (e.g. ``@given("there are <start> cucumbers")``) should use step argument parsers in order to match the scenario outlines and get the values from the example tables. The values from the example tables are no longer passed as fixtures per se, although if you define your step to use a parser, the parameters will be still provided as fixtures.
Templated steps (e.g. ``@given("there are <start> cucumbers")``) should now the use step argument parsers in order to match the scenario outlines and get the values from the example tables. The values from the example tables are no longer passed as fixtures, although if you define your step to use a parser, the parameters will be still provided as fixtures.
.. code-block:: python
@ -1188,6 +1188,7 @@ The templated steps (e.g. ``@given("there are <start> cucumbers")``) should use
def given_cucumbers(start):
pass
# New step definition:
@given(parsers.parse("there are {start} cucumbers"))
def given_cucumbers(start):
@ -1207,6 +1208,7 @@ Scenario `example_converters` are removed in favor of the converters provided on
def test_outline():
pass
# New code:
@given(parsers.parse("there are {start} cucumbers"), converters={"start": float})
def given_cucumbers(start):