From 7175fe71020f644418070ffef32b5db244415323 Mon Sep 17 00:00:00 2001 From: Lars Holmberg Date: Mon, 14 Jun 2021 13:11:09 +0200 Subject: [PATCH] Make FastHttpUser use the same name for request_meta as HttpUser (no leading underscore) --- locust/contrib/fasthttp.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/locust/contrib/fasthttp.py b/locust/contrib/fasthttp.py index 235caf1e20..89f5a23de5 100644 --- a/locust/contrib/fasthttp.py +++ b/locust/contrib/fasthttp.py @@ -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 @@ -429,14 +429,14 @@ 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 @@ -444,13 +444,13 @@ def __exit__(self, exc, value, traceback): 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): """