-
Notifications
You must be signed in to change notification settings - Fork 219
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #713 from jsa34/asterisk-steps
Add test to use asterisks to continue step type instead of And or But
- Loading branch information
Showing
3 changed files
with
113 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import textwrap | ||
|
||
|
||
def test_asterisk_keyword(pytester): | ||
pytester.makefile( | ||
".feature", | ||
asterisk=textwrap.dedent( | ||
"""\ | ||
Feature: Step continuation | ||
Scenario: Asterisk steps | ||
Given I am out shopping | ||
* I have eggs | ||
* I have milk | ||
* I have butter | ||
When I check my list | ||
Then I don't need anything | ||
""" | ||
), | ||
) | ||
pytester.makepyfile( | ||
textwrap.dedent( | ||
"""\ | ||
import pytest | ||
from pytest_bdd import given, when, then, scenario | ||
@scenario("asterisk.feature", "Asterisk steps") | ||
def test_asterisk_steps(): | ||
pass | ||
@given("I am out shopping") | ||
def _(): | ||
pass | ||
@given("I have eggs") | ||
def _(): | ||
pass | ||
@given("I have milk") | ||
def _(): | ||
pass | ||
@given("I have butter") | ||
def _(): | ||
pass | ||
@when("I check my list") | ||
def _(): | ||
pass | ||
@then("I don't need anything") | ||
def _(): | ||
pass | ||
""" | ||
) | ||
) | ||
result = pytester.runpytest() | ||
result.assert_outcomes(passed=1) |