README fix: @scenario instead of @mark.scenario; added accompanying gherkin file, too.

This commit is contained in:
Joshua Pereyda 2016-01-13 19:38:26 -08:00
parent 2e56eed167
commit 671055a501
1 changed files with 14 additions and 2 deletions

View File

@ -621,14 +621,14 @@ The code will look like:
.. code-block:: python
import pytest
from pytest_bdd import mark, given, when, then
from pytest_bdd import scenario, given, when, then
# Here we use pytest to parametrize the test with the parameters table
@pytest.mark.parametrize(
['start', 'eat', 'left'],
[(12, 5, 7)])
@mark.scenario(
@scenario(
'parametrized.feature',
'Parametrized given, when, thens',
)
@ -654,6 +654,18 @@ The code will look like:
assert start_cucumbers['start'] == start
assert start_cucumbers['eat'] == eat
With a parametrized.feature file:
.. code-block:: gherkin
Feature: parametrized
Scenario: Parametrized given, when, thens
Given there are <start> cucumbers
When I eat <eat> cucumbers
Then I should have <left> cucumbers
The significant downside of this approach is inability to see the test table from the feature file.