You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.rst
+5-6Lines changed: 5 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -32,7 +32,7 @@ Install `pytest-bdd` using `pip`:
32
32
Example
33
33
-------
34
34
35
-
An example test for a blog hosting software could look like this. Note that pytest-splinter_ is used to get the is used to get the browser fixture.
35
+
An example test for a blog hosting software could look like this. Note that pytest-splinter_ is used to get the browser fixture.
36
36
37
37
.. code-block:: gherkin
38
38
@@ -83,7 +83,7 @@ An example test for a blog hosting software could look like this. Note that pyte
83
83
assert article.is_published
84
84
85
85
Declaring tests in python files
86
-
------------------
86
+
-------------------------------
87
87
The recommended approach to run tests defined by feature files is to create a python test module for each feature file, and define the step implementation within the module:
88
88
89
89
.. code-block:: python
@@ -100,7 +100,6 @@ The recommended approach to run tests defined by feature files is to create a py
100
100
101
101
...
102
102
103
-
104
103
You can also decide to collect all the feature files found in a directory. For example, this will collect all the feature files from the `features` folder recursively:
105
104
106
105
.. code-block:: python
@@ -232,7 +231,7 @@ Example with `re` parser
232
231
Implementing a custom step parser
233
232
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
234
233
235
-
You can implement your own step parser. It's interface is quite simple. The code can look like:
234
+
You can implement your own step parser. Its interface is quite simple. The code can look like:
236
235
237
236
.. code-block:: python
238
237
@@ -258,7 +257,7 @@ You can implement your own step parser. It's interface is quite simple. The code
258
257
return {"count": int(start)}
259
258
260
259
Override fixtures (injection)
261
-
---------------------------------
260
+
-----------------------------
262
261
263
262
To imperatively change a fixture only for certain tests (scenarios), use the ``target_fixture`` parameter in the `given` decorator:
264
263
@@ -559,7 +558,7 @@ features.
559
558
560
559
Scenario: Greg posts to a client's blog
561
560
Given I am logged in as Greg
562
-
When I try to post to "Expensive Therapy"
561
+
When I try to post to "Expensive Therapy"
563
562
Then I should see "Your article was published."
564
563
565
564
In this example, all steps from the background will be executed before all the scenario's own given
0 commit comments