locust 2.47.1.dev75__tar.gz → 2.48.0__tar.gz

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.
Files changed (69) hide show
  1. {locust-2.47.1.dev75 → locust-2.48.0}/PKG-INFO +1 -1
  2. {locust-2.47.1.dev75 → locust-2.48.0}/locust/_version.py +2 -2
  3. {locust-2.47.1.dev75 → locust-2.48.0}/locust/argument_parser.py +6 -7
  4. {locust-2.47.1.dev75 → locust-2.48.0}/locust/clients.py +8 -1
  5. {locust-2.47.1.dev75 → locust-2.48.0}/locust/contrib/fasthttp.py +5 -1
  6. {locust-2.47.1.dev75 → locust-2.48.0}/locust/contrib/mqtt.py +16 -17
  7. {locust-2.47.1.dev75 → locust-2.48.0}/locust/web.py +11 -12
  8. {locust-2.47.1.dev75 → locust-2.48.0}/pyproject.toml +2 -2
  9. {locust-2.47.1.dev75 → locust-2.48.0}/.gitignore +0 -0
  10. {locust-2.47.1.dev75 → locust-2.48.0}/LICENSE +0 -0
  11. {locust-2.47.1.dev75 → locust-2.48.0}/README.md +0 -0
  12. {locust-2.47.1.dev75 → locust-2.48.0}/hatch_build.py +0 -0
  13. {locust-2.47.1.dev75 → locust-2.48.0}/locust/__init__.py +0 -0
  14. {locust-2.47.1.dev75 → locust-2.48.0}/locust/__main__.py +0 -0
  15. {locust-2.47.1.dev75 → locust-2.48.0}/locust/contrib/__init__.py +0 -0
  16. {locust-2.47.1.dev75 → locust-2.48.0}/locust/contrib/csv_request_logger.py +0 -0
  17. {locust-2.47.1.dev75 → locust-2.48.0}/locust/contrib/dns.py +0 -0
  18. {locust-2.47.1.dev75 → locust-2.48.0}/locust/contrib/milvus.py +0 -0
  19. {locust-2.47.1.dev75 → locust-2.48.0}/locust/contrib/mongodb.py +0 -0
  20. {locust-2.47.1.dev75 → locust-2.48.0}/locust/contrib/oai.py +0 -0
  21. {locust-2.47.1.dev75 → locust-2.48.0}/locust/contrib/postgres.py +0 -0
  22. {locust-2.47.1.dev75 → locust-2.48.0}/locust/contrib/qdrant.py +0 -0
  23. {locust-2.47.1.dev75 → locust-2.48.0}/locust/contrib/socketio.py +0 -0
  24. {locust-2.47.1.dev75 → locust-2.48.0}/locust/debug.py +0 -0
  25. {locust-2.47.1.dev75 → locust-2.48.0}/locust/dispatch.py +0 -0
  26. {locust-2.47.1.dev75 → locust-2.48.0}/locust/env.py +0 -0
  27. {locust-2.47.1.dev75 → locust-2.48.0}/locust/event.py +0 -0
  28. {locust-2.47.1.dev75 → locust-2.48.0}/locust/exception.py +0 -0
  29. {locust-2.47.1.dev75 → locust-2.48.0}/locust/html.py +0 -0
  30. {locust-2.47.1.dev75 → locust-2.48.0}/locust/input_events.py +0 -0
  31. {locust-2.47.1.dev75 → locust-2.48.0}/locust/log.py +0 -0
  32. {locust-2.47.1.dev75 → locust-2.48.0}/locust/main.py +0 -0
  33. {locust-2.47.1.dev75 → locust-2.48.0}/locust/opentelemetry.py +0 -0
  34. {locust-2.47.1.dev75 → locust-2.48.0}/locust/py.typed +0 -0
  35. {locust-2.47.1.dev75 → locust-2.48.0}/locust/rpc/__init__.py +0 -0
  36. {locust-2.47.1.dev75 → locust-2.48.0}/locust/rpc/protocol.py +0 -0
  37. {locust-2.47.1.dev75 → locust-2.48.0}/locust/rpc/zmqrpc.py +0 -0
  38. {locust-2.47.1.dev75 → locust-2.48.0}/locust/runners.py +0 -0
  39. {locust-2.47.1.dev75 → locust-2.48.0}/locust/shape.py +0 -0
  40. {locust-2.47.1.dev75 → locust-2.48.0}/locust/stats.py +0 -0
  41. {locust-2.47.1.dev75 → locust-2.48.0}/locust/user/__init__.py +0 -0
  42. {locust-2.47.1.dev75 → locust-2.48.0}/locust/user/inspectuser.py +0 -0
  43. {locust-2.47.1.dev75 → locust-2.48.0}/locust/user/markov_taskset.py +0 -0
  44. {locust-2.47.1.dev75 → locust-2.48.0}/locust/user/sequential_taskset.py +0 -0
  45. {locust-2.47.1.dev75 → locust-2.48.0}/locust/user/task.py +0 -0
  46. {locust-2.47.1.dev75 → locust-2.48.0}/locust/user/users.py +0 -0
  47. {locust-2.47.1.dev75 → locust-2.48.0}/locust/user/wait_time.py +0 -0
  48. {locust-2.47.1.dev75 → locust-2.48.0}/locust/util/__init__.py +0 -0
  49. {locust-2.47.1.dev75 → locust-2.48.0}/locust/util/cache.py +0 -0
  50. {locust-2.47.1.dev75 → locust-2.48.0}/locust/util/date.py +0 -0
  51. {locust-2.47.1.dev75 → locust-2.48.0}/locust/util/deprecation.py +0 -0
  52. {locust-2.47.1.dev75 → locust-2.48.0}/locust/util/directory.py +0 -0
  53. {locust-2.47.1.dev75 → locust-2.48.0}/locust/util/exception_handler.py +0 -0
  54. {locust-2.47.1.dev75 → locust-2.48.0}/locust/util/load_locustfile.py +0 -0
  55. {locust-2.47.1.dev75 → locust-2.48.0}/locust/util/rounding.py +0 -0
  56. {locust-2.47.1.dev75 → locust-2.48.0}/locust/util/timespan.py +0 -0
  57. {locust-2.47.1.dev75 → locust-2.48.0}/locust/util/url.py +0 -0
  58. {locust-2.47.1.dev75 → locust-2.48.0}/locust/webui/dist/assets/favicon-dark.png +0 -0
  59. {locust-2.47.1.dev75 → locust-2.48.0}/locust/webui/dist/assets/favicon-light.png +0 -0
  60. {locust-2.47.1.dev75 → locust-2.48.0}/locust/webui/dist/assets/graphs-dark.png +0 -0
  61. {locust-2.47.1.dev75 → locust-2.48.0}/locust/webui/dist/assets/graphs-light.png +0 -0
  62. {locust-2.47.1.dev75 → locust-2.48.0}/locust/webui/dist/assets/src-Cl6CiemE.js +0 -0
  63. {locust-2.47.1.dev75 → locust-2.48.0}/locust/webui/dist/assets/terminal.gif +0 -0
  64. {locust-2.47.1.dev75 → locust-2.48.0}/locust/webui/dist/assets/testruns-dark.png +0 -0
  65. {locust-2.47.1.dev75 → locust-2.48.0}/locust/webui/dist/assets/testruns-light.png +0 -0
  66. {locust-2.47.1.dev75 → locust-2.48.0}/locust/webui/dist/auth.html +0 -0
  67. {locust-2.47.1.dev75 → locust-2.48.0}/locust/webui/dist/index.html +0 -0
  68. {locust-2.47.1.dev75 → locust-2.48.0}/locust/webui/dist/report.html +0 -0
  69. {locust-2.47.1.dev75 → locust-2.48.0}/pytest_locust/plugin.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: locust
3
- Version: 2.47.1.dev75
3
+ Version: 2.48.0
4
4
  Summary: Developer-friendly load testing framework
5
5
  Project-URL: Homepage, https://locust.cloud/
6
6
  Project-URL: Repository, https://github.com/locustio/locust
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
18
18
  commit_id: str | None
19
19
  __commit_id__: str | None
20
20
 
21
- __version__ = version = '2.47.1.dev75'
22
- __version_tuple__ = version_tuple = (2, 47, 1, 'dev75')
21
+ __version__ = version = '2.48.0'
22
+ __version_tuple__ = version_tuple = (2, 48, 0)
23
23
 
24
24
  __commit_id__ = commit_id = None
@@ -174,14 +174,13 @@ def _parse_locustfile_path(path: str) -> list[str]:
174
174
  if not parsed_paths:
175
175
  sys.stderr.write(f"Could not find any locustfiles in directory '{path}'")
176
176
  sys.exit(1)
177
+ # If file exists add the abspath
178
+ elif os.path.exists(path) and path.endswith(".py"):
179
+ parsed_paths.append(os.path.abspath(path))
177
180
  else:
178
- # If file exists add the abspath
179
- if os.path.exists(path) and path.endswith(".py"):
180
- parsed_paths.append(os.path.abspath(path))
181
- else:
182
- note_about_file_endings = "Ensure your locustfile ends with '.py' or is a directory with locustfiles. "
183
- sys.stderr.write(f"Could not find '{path}'. {note_about_file_endings}See --help for available options.\n")
184
- sys.exit(1)
181
+ note_about_file_endings = "Ensure your locustfile ends with '.py' or is a directory with locustfiles. "
182
+ sys.stderr.write(f"Could not find '{path}'. {note_about_file_endings}See --help for available options.\n")
183
+ sys.exit(1)
185
184
 
186
185
  return parsed_paths
187
186
 
@@ -103,7 +103,14 @@ class HttpSession(requests.Session):
103
103
  # remove username and password from the base_url (keeping e.g. the brackets of an IPv6 host)
104
104
  netloc = parsed_url.netloc.rpartition("@")[2]
105
105
  self.base_url = urlunparse(
106
- (parsed_url.scheme, netloc, parsed_url.path, parsed_url.params, parsed_url.query, parsed_url.fragment)
106
+ (
107
+ parsed_url.scheme,
108
+ netloc,
109
+ parsed_url.path,
110
+ parsed_url.params,
111
+ parsed_url.query,
112
+ parsed_url.fragment,
113
+ )
107
114
  )
108
115
  # configure requests to use basic auth (credentials in a URL are percent-encoded)
109
116
  self.auth = HTTPBasicAuth(unquote(parsed_url.username), unquote(parsed_url.password))
@@ -211,7 +211,7 @@ class FastHttpSession:
211
211
  def request(
212
212
  self,
213
213
  method: str,
214
- url: str,
214
+ url: str | bytes,
215
215
  name: str | None = None,
216
216
  data: str | dict | list | tuple | None = None,
217
217
  catch_response: bool = False,
@@ -254,6 +254,10 @@ class FastHttpSession:
254
254
  :return: A :py:class:`FastResponse <locust.contrib.fasthttp.FastResponse>` object if catch_response is False, and
255
255
  :py:class:`ResponseContextManager <locust.contrib.fasthttp.ResponseContextManager>` if True.
256
256
  """
257
+ # accept a bytes URL, as HttpSession and requests do, and record its name as text
258
+ if isinstance(url, bytes):
259
+ url = url.decode("utf-8")
260
+
257
261
  # if group name has been set and no name parameter has been passed in; set the name parameter to group_name
258
262
  if self.request_name and not name:
259
263
  name = self.request_name
@@ -492,24 +492,23 @@ class MqttClient(mqtt.Client):
492
492
  "start_time": start_time,
493
493
  },
494
494
  )
495
+ elif mid is None:
496
+ # QoS 0 subscriptions do not have a mid, so we'll just fire a success event immediately
497
+ self.environment.events.request.fire(
498
+ request_type=REQUEST_TYPE,
499
+ name=self._generate_event_name("subscribe", qos, subscribe_topic),
500
+ response_time=(time.time() - start_time) * 1000,
501
+ response_length=0,
502
+ exception=None,
503
+ context={
504
+ "client_id": self.client_id,
505
+ "qos": qos,
506
+ "topic": subscribe_topic,
507
+ "start_time": start_time,
508
+ },
509
+ )
495
510
  else:
496
- if mid is None:
497
- # QoS 0 subscriptions do not have a mid, so we'll just fire a success event immediately
498
- self.environment.events.request.fire(
499
- request_type=REQUEST_TYPE,
500
- name=self._generate_event_name("subscribe", qos, subscribe_topic),
501
- response_time=(time.time() - start_time) * 1000,
502
- response_length=0,
503
- exception=None,
504
- context={
505
- "client_id": self.client_id,
506
- "qos": qos,
507
- "topic": subscribe_topic,
508
- "start_time": start_time,
509
- },
510
- )
511
- else:
512
- self._subscribe_requests[mid] = (qos, subscribe_topic, start_time)
511
+ self._subscribe_requests[mid] = (qos, subscribe_topic, start_time)
513
512
 
514
513
  return result, mid
515
514
 
@@ -240,19 +240,18 @@ class WebUI:
240
240
  if user_class_name in form_data_user_class_names
241
241
  }
242
242
 
243
+ elif self.environment.runner and self.environment.runner.state == STATE_RUNNING:
244
+ # Test is already running
245
+ # Using the user classes that have already been selected
246
+ user_classes = {
247
+ key: value
248
+ for (key, value) in self.environment.available_user_classes.items()
249
+ if value in self.environment.user_classes
250
+ }
243
251
  else:
244
- if self.environment.runner and self.environment.runner.state == STATE_RUNNING:
245
- # Test is already running
246
- # Using the user classes that have already been selected
247
- user_classes = {
248
- key: value
249
- for (key, value) in self.environment.available_user_classes.items()
250
- if value in self.environment.user_classes
251
- }
252
- else:
253
- # Starting test with no user class selection
254
- # Defaulting to using all available user classes
255
- user_classes = self.environment.available_user_classes
252
+ # Starting test with no user class selection
253
+ # Defaulting to using all available user classes
254
+ user_classes = self.environment.available_user_classes
256
255
 
257
256
  self._update_user_classes(user_classes)
258
257
 
@@ -87,7 +87,7 @@ test = [
87
87
  ]
88
88
  lint = [
89
89
  "pre-commit>=4.7.0,<5.0.0",
90
- "ruff==0.17.2",
90
+ "ruff==0.17.5",
91
91
  "mypy>=1.13.0,<1.15.0",
92
92
  "types-requests==2.33.0.20260906",
93
93
  "typos>=1.51.1"
@@ -169,7 +169,7 @@ extend-exclude = [
169
169
  "examples/grpc/hello_pb2*.py",
170
170
  ]
171
171
  lint.ignore = ["E402", "E501", "E713", "E731", "E741", "UP031", "PERF203", "RUF012", "RUF015"]
172
- lint.select = ["E", "F", "W", "UP", "FA102", "I001", "FURB", "PERF", "RUF"]
172
+ lint.select = ["E", "F", "W", "UP", "FA102", "I001", "FURB", "PERF", "RUF", "PLE"]
173
173
  lint.dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?)|resp)$"
174
174
 
175
175
  [tool.ruff.lint.per-file-ignores]
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes