From 2193f0e161d3e70a225910cff77fc0bd2485137a Mon Sep 17 00:00:00 2001 From: Artalus Date: Sat, 29 Apr 2023 15:56:55 +0400 Subject: [PATCH 1/3] Test that asterisk behaves same as And --- tests/feature/test_steps.py | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 """ ) ) From 52328b898f970f18b8ca804ec743518d5267f7ed Mon Sep 17 00:00:00 2001 From: Artalus Date: Sat, 29 Apr 2023 15:57:19 +0400 Subject: [PATCH 2/3] Add asterisk as continuation step --- src/pytest_bdd/parser.py | 1 + 1 file changed, 1 insertion(+) 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] From c80dadc8958aef29c643aca928249b0dc22e5c0f Mon Sep 17 00:00:00 2001 From: Artalus Date: Sat, 29 Apr 2023 16:17:49 +0400 Subject: [PATCH 3/3] Update changelog --- CHANGES.rst | 1 + 1 file changed, 1 insertion(+) 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 -----