forked from pytest-dev/pytest-bdd
-
Notifications
You must be signed in to change notification settings - Fork 3
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 #132 from elchupanebrej/release/2.3.0
Release backmerge
- Loading branch information
Showing
27 changed files
with
2,947 additions
and
2,901 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,40 @@ | ||
Feature: Descriptions | ||
^^^^^^^^^^^^^^^^^^^^^ | ||
Free-form descriptions can be placed underneath Feature, | ||
Example/Scenario, Background, Scenario Outline and Rule. You can write | ||
anything you like, as long as no line starts with a keyword. | ||
Descriptions can be in the form of Markdown - formatters including the | ||
official HTML formatter support this. | ||
Scenario: | ||
''''''''' | ||
- Given File "Description.feature" with content: | ||
.. code:: gherkin | ||
Feature: | ||
My Feature description | ||
Scenario: | ||
Given I check feature description | ||
- And File "conftest.py" with content: | ||
.. code:: python | ||
from pytest_bdd import given | ||
@given('I check feature description') | ||
def step(feature): | ||
assert feature.description == "My Feature description" | ||
- When run pytest | ||
- Then pytest outcome must contain tests with statuses: | ||
====== ====== | ||
passed failed | ||
====== ====== | ||
1 0 | ||
====== ====== | ||
Feature: Descriptions | ||
^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
Free-form descriptions can be placed underneath Feature, | ||
Example/Scenario, Background, Scenario Outline and Rule. You can write | ||
anything you like, as long as no line starts with a keyword. | ||
Descriptions can be in the form of Markdown - formatters including the | ||
official HTML formatter support this. | ||
|
||
Scenario: | ||
''''''''' | ||
|
||
- Given File "Description.feature" with content: | ||
|
||
.. code:: gherkin | ||
Feature: | ||
My Feature description | ||
Scenario: | ||
Given I check feature description | ||
- And File "conftest.py" with content: | ||
|
||
.. code:: python | ||
from pytest_bdd import given | ||
@given('I check feature description') | ||
def step(feature): | ||
assert feature.description == "My Feature description" | ||
- When run pytest | ||
|
||
- Then pytest outcome must contain tests with statuses: | ||
|
||
====== ====== | ||
passed failed | ||
====== ====== | ||
1 0 | ||
====== ====== |
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 |
---|---|---|
@@ -1,96 +1,96 @@ | ||
Feature: Gherkin features autoload | ||
'''''''''''''''''''''''''''''''''' | ||
By default gherkin features are autoloaded and treated as usual pytest | ||
tests if are placed in the tests hierarchy proposed by pytest. This | ||
behavior could be disabled | ||
Rule: Feature autoload | ||
Background: | ||
- Given File "Passing.feature" with content: | ||
.. code:: gherkin | ||
Feature: Passing feature | ||
Scenario: Passing scenario | ||
* Passing step | ||
- Given File "Another.passing.feature.md" with content: | ||
.. code:: markdown | ||
# Feature: Passing feature | ||
## Scenario: Passing scenario | ||
* Given Passing step | ||
- Given Install npm packages | ||
======== ================= | ||
packages @cucumber/gherkin | ||
======== ================= | ||
======== ================= | ||
- Given File "conftest.py" with content: | ||
.. code:: python | ||
from pytest_bdd import step | ||
@step('Passing step') | ||
def _(): | ||
... | ||
Scenario: Feature is loaded by default | ||
- When run pytest | ||
- Then pytest outcome must contain tests with statuses: | ||
+--------+ | ||
| passed | | ||
+========+ | ||
| 2 | | ||
+--------+ | ||
Scenario: Feature autoload could be disabled via command line | ||
- When run pytest | ||
======== ========================== | ||
cli_args --disable-feature-autoload | ||
======== ========================== | ||
======== ========================== | ||
- Then pytest outcome must contain tests with statuses: | ||
+--------+ | ||
| passed | | ||
+========+ | ||
| 0 | | ||
+--------+ | ||
Scenario: Feature autoload could be disabled via pytest.ini | ||
- Given Set pytest.ini content to: | ||
.. code:: ini | ||
[pytest] | ||
disable_feature_autoload=true | ||
- When run pytest | ||
- Then pytest outcome must contain tests with statuses: | ||
+--------+ | ||
| passed | | ||
+========+ | ||
| 0 | | ||
+--------+ | ||
Feature: Gherkin features autoload | ||
'''''''''''''''''''''''''''''''''' | ||
|
||
By default gherkin features are autoloaded and treated as usual pytest | ||
tests if are placed in the tests hierarchy proposed by pytest. This | ||
behavior could be disabled | ||
|
||
Rule: Feature autoload | ||
|
||
|
||
Background: | ||
|
||
|
||
- Given File "Passing.feature" with content: | ||
|
||
.. code:: gherkin | ||
Feature: Passing feature | ||
Scenario: Passing scenario | ||
* Passing step | ||
- Given File "Another.passing.feature.md" with content: | ||
|
||
.. code:: markdown | ||
# Feature: Passing feature | ||
## Scenario: Passing scenario | ||
* Given Passing step | ||
- Given Install npm packages | ||
|
||
======== ================= | ||
packages @cucumber/gherkin | ||
======== ================= | ||
======== ================= | ||
|
||
- Given File "conftest.py" with content: | ||
|
||
.. code:: python | ||
from pytest_bdd import step | ||
@step('Passing step') | ||
def _(): | ||
... | ||
Scenario: Feature is loaded by default | ||
|
||
|
||
- When run pytest | ||
- Then pytest outcome must contain tests with statuses: | ||
|
||
+--------+ | ||
| passed | | ||
+========+ | ||
| 2 | | ||
+--------+ | ||
|
||
Scenario: Feature autoload could be disabled via command line | ||
|
||
|
||
- When run pytest | ||
|
||
======== ========================== | ||
cli_args --disable-feature-autoload | ||
======== ========================== | ||
======== ========================== | ||
|
||
- Then pytest outcome must contain tests with statuses: | ||
|
||
+--------+ | ||
| passed | | ||
+========+ | ||
| 0 | | ||
+--------+ | ||
|
||
Scenario: Feature autoload could be disabled via pytest.ini | ||
|
||
|
||
- Given Set pytest.ini content to: | ||
|
||
.. code:: ini | ||
[pytest] | ||
disable_feature_autoload=true | ||
- When run pytest | ||
|
||
- Then pytest outcome must contain tests with statuses: | ||
|
||
+--------+ | ||
| passed | | ||
+========+ | ||
| 0 | | ||
+--------+ |
Oops, something went wrong.