Merge pull request #170 from jtpereyda/readme-mark-parametrize-fix

Issue #169 fix : @scenario instead of @mark.scenario; added accompanying gherkin file, too.
This commit is contained in:
Florian Bruhin 2016-01-24 19:58:58 +01:00
commit 1eff034a6d
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.