locust 2.32.0__py3-none-any.whl → 2.32.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- locust/_version.py +2 -2
- locust/contrib/fasthttp.py +13 -0
- locust/debug.py +1 -1
- locust/web.py +4 -0
- locust/webui/dist/assets/{index-C35vpr6y.js → index-LlbhTJVf.js} +56 -56
- locust/webui/dist/auth.html +1 -1
- locust/webui/dist/index.html +1 -1
- locust/webui/dist/report.html +48 -48
- {locust-2.32.0.dist-info → locust-2.32.1.dist-info}/METADATA +1 -1
- {locust-2.32.0.dist-info → locust-2.32.1.dist-info}/RECORD +14 -14
- poetry.lock +178 -167
- {locust-2.32.0.dist-info → locust-2.32.1.dist-info}/LICENSE +0 -0
- {locust-2.32.0.dist-info → locust-2.32.1.dist-info}/WHEEL +0 -0
- {locust-2.32.0.dist-info → locust-2.32.1.dist-info}/entry_points.txt +0 -0
locust/_version.py
CHANGED
locust/contrib/fasthttp.py
CHANGED
@@ -587,6 +587,14 @@ class ErrorResponse:
|
|
587
587
|
raise self.error
|
588
588
|
|
589
589
|
|
590
|
+
class LocustBadStatusCode(ConnectionError):
|
591
|
+
def __repr__(self):
|
592
|
+
repr_str = super().__repr__()
|
593
|
+
if self.kw_text:
|
594
|
+
return repr_str.replace(repr(self.url) + ", ", "")
|
595
|
+
return repr_str
|
596
|
+
|
597
|
+
|
590
598
|
class LocustUserAgent(UserAgent):
|
591
599
|
response_type = FastResponse
|
592
600
|
request_type = FastRequest
|
@@ -606,6 +614,11 @@ class LocustUserAgent(UserAgent):
|
|
606
614
|
)
|
607
615
|
return self.response_type(resp, request=request, sent_request=resp._sent_request)
|
608
616
|
|
617
|
+
def _verify_status(self, status_code, url=None):
|
618
|
+
"""Hook for subclassing"""
|
619
|
+
if status_code not in self.valid_response_codes:
|
620
|
+
raise LocustBadStatusCode(url, code=status_code)
|
621
|
+
|
609
622
|
|
610
623
|
class ResponseContextManager(FastResponse):
|
611
624
|
"""
|
locust/debug.py
CHANGED
@@ -150,7 +150,7 @@ def run_single_user(
|
|
150
150
|
_env.events.init.fire(environment=_env, runner=None, web_ui=None)
|
151
151
|
# uncaught events will be suppressed, so check if that happened
|
152
152
|
if locust.log.unhandled_greenlet_exception:
|
153
|
-
|
153
|
+
os._exit(1)
|
154
154
|
|
155
155
|
# do the things that the Runner usually does
|
156
156
|
_env.user_classes = [user_class]
|
locust/web.py
CHANGED
@@ -24,6 +24,7 @@ from flask import (
|
|
24
24
|
request,
|
25
25
|
send_file,
|
26
26
|
send_from_directory,
|
27
|
+
session,
|
27
28
|
url_for,
|
28
29
|
)
|
29
30
|
from flask_cors import CORS
|
@@ -504,6 +505,8 @@ class WebUI:
|
|
504
505
|
if not self.web_login:
|
505
506
|
return redirect(url_for("index"))
|
506
507
|
|
508
|
+
self.auth_args["error"] = session.get("auth_error", None)
|
509
|
+
|
507
510
|
return render_template_from(
|
508
511
|
"auth.html",
|
509
512
|
auth_args=self.auth_args,
|
@@ -573,6 +576,7 @@ class WebUI:
|
|
573
576
|
def wrapper(*args, **kwargs):
|
574
577
|
if self.web_login:
|
575
578
|
try:
|
579
|
+
session["auth_error"] = None
|
576
580
|
return login_required(view_func)(*args, **kwargs)
|
577
581
|
except Exception as e:
|
578
582
|
return f"Locust auth exception: {e} See https://docs.locust.io/en/stable/extending-locust.html#adding-authentication-to-the-web-ui for configuring authentication."
|