Skip to content

Commit

Permalink
Merge pull request #1123 from locustio/fix-self.client-call-in-code-e…
Browse files Browse the repository at this point in the history
…xamples

fix self.client call in code examples
  • Loading branch information
heyman authored Oct 26, 2019
2 parents 98ecd83 + a033bf1 commit d3a195d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/writing-a-locustfile.rst
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ One can mark requests as failed, even when the response code is OK, by using the

.. code-block:: python
with client.get("/", catch_response=True) as response:
with self.client.get("/", catch_response=True) as response:
if response.content != b"Success":
response.failure("Got wrong response")
Expand All @@ -431,7 +431,7 @@ be reported as a success in the statistics:

.. code-block:: python
with client.get("/does_not_exist/", catch_response=True) as response:
with self.client.get("/does_not_exist/", catch_response=True) as response:
if response.status_code == 404:
response.success()
Expand All @@ -450,7 +450,7 @@ Example:
# Statistics for these requests will be grouped under: /blog/?id=[id]
for i in range(10):
client.get("/blog?id=%i" % i, name="/blog?id=[id]")
self.client.get("/blog?id=%i" % i, name="/blog?id=[id]")
Common libraries
=================
Expand Down

0 comments on commit d3a195d

Please sign in to comment.