Skip to content

Commit

Permalink
Make FastHttpUser use the same name for request_meta as HttpUser (no …
Browse files Browse the repository at this point in the history
…leading underscore)
  • Loading branch information
cyberw committed Jun 14, 2021
1 parent 198fc7c commit 7175fe7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions locust/contrib/fasthttp.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ def __init__(self, response, environment, request_meta):
self._cached_content = response.content
# store reference to locust Environment
self._environment = environment
self._request_meta = request_meta
self.request_meta = request_meta

def __enter__(self):
return self
Expand All @@ -429,28 +429,28 @@ def __exit__(self, exc, value, traceback):
if self._manual_result is True:
self._report_request()
elif isinstance(self._manual_result, Exception):
self._request_meta["exception"] = self._manual_result
self.request_meta["exception"] = self._manual_result
self._report_request()

return exc is None

if exc:
if isinstance(value, ResponseError):
self._request_meta["exception"] = value
self.request_meta["exception"] = value
self._report_request()
else:
return False
else:
try:
self.raise_for_status()
except FAILURE_EXCEPTIONS as e:
self._request_meta["exception"] = e
self.request_meta["exception"] = e
self._report_request()

return True

def _report_request(self):
self._environment.events.request.fire(**self._request_meta)
self._environment.events.request.fire(**self.request_meta)

def success(self):
"""
Expand Down

0 comments on commit 7175fe7

Please sign in to comment.