Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix self.client call in code examples #1123

Merged
merged 1 commit into from
Oct 26, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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