diff --git a/CHANGES.rst b/CHANGES.rst index 4eb8037b2..1b6973465 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -5,6 +5,7 @@ Unreleased ---------- - ⚠️ Backwards incompatible: - ``parsers.re`` now does a `fullmatch `_ instead of a partial match. This is to make it work just like the other parsers, since they don't ignore non-matching characters at the end of the string. `#539 `_ - Add support for Scenarios and Scenario Outlines to have descriptions. `#600 `_ +- Add support for asterisks ( ``*`` ) as continuation steps. `#??? `_ 6.1.1 ----- diff --git a/src/pytest_bdd/parser.py b/src/pytest_bdd/parser.py index aa7c4ec77..a77b98937 100644 --- a/src/pytest_bdd/parser.py +++ b/src/pytest_bdd/parser.py @@ -26,6 +26,7 @@ # Continuation of the previously mentioned step type ("And ", None), ("But ", None), + ("* ", None), ] TYPES_WITH_DESCRIPTIONS = [types.FEATURE, types.SCENARIO, types.SCENARIO_OUTLINE] diff --git a/tests/feature/test_steps.py b/tests/feature/test_steps.py index 30b731c0a..901de7741 100644 --- a/tests/feature/test_steps.py +++ b/tests/feature/test_steps.py @@ -18,6 +18,13 @@ def test_steps(pytester): And I append 3 to the list Then foo should have value "foo" But the list should be [1, 2, 3] + + Given there is a list + When values appended via asterisks: + * I append 1 to the list + * I append 2 to the list + * I append 3 to the list + Then the list should be [1, 2, 3] """ ), ) @@ -65,6 +72,9 @@ def _(foo): def _(results): assert results == [1, 2, 3] + @when("values appended via asterisks:") + def _(): + pass """ ) )