Skip to content

Commit

Permalink
Dont fail on "... takes 1 positional argument but 2 were given" when …
Browse files Browse the repository at this point in the history
…trying to give descriptive error message when .failure/.success is called without a catch_response=True
  • Loading branch information
Lars Holmberg committed Jun 17, 2024
1 parent a074213 commit 415ca8c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions locust/clients.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,13 +314,13 @@ def init_poolmanager(self, *args, **kwargs):


# Monkey patch Response class to give some guidance
def _success(self):
def _success(self, *_args, **_kwargs):
raise LocustError(
"If you want to change the state of the request, you must pass catch_response=True. See http://docs.locust.io/en/stable/writing-a-locustfile.html#validating-responses"
)


def _failure(self):
def _failure(self, *_args, **_kwargs):
raise LocustError(
"If you want to change the state of the request, you must pass catch_response=True. See http://docs.locust.io/en/stable/writing-a-locustfile.html#validating-responses"
)
Expand Down

0 comments on commit 415ca8c

Please sign in to comment.