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

Make FastHttpUser use the same name for request_meta as HttpUser (no leading underscore) #1788

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
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