locust 2.40.6.dev1__py3-none-any.whl → 2.40.6.dev4__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 CHANGED
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
28
28
  commit_id: COMMIT_ID
29
29
  __commit_id__: COMMIT_ID
30
30
 
31
- __version__ = version = '2.40.6.dev1'
32
- __version_tuple__ = version_tuple = (2, 40, 6, 'dev1')
31
+ __version__ = version = '2.40.6.dev4'
32
+ __version_tuple__ = version_tuple = (2, 40, 6, 'dev4')
33
33
 
34
34
  __commit_id__ = commit_id = None
locust/argument_parser.py CHANGED
@@ -7,6 +7,7 @@ from locust.rpc import Message, zmqrpc
7
7
  import argparse
8
8
  import ast
9
9
  import atexit
10
+ import difflib
10
11
  import json
11
12
  import os
12
13
  import platform
@@ -60,6 +61,18 @@ class LocustArgumentParser(configargparse.ArgumentParser):
60
61
  optionally exclude arguments from the UI.
61
62
  """
62
63
 
64
+ def error(self, message):
65
+ # Extract the unknown option from the error message
66
+ if "unrecognized arguments:" in message:
67
+ bad_arg = message.split("unrecognized arguments:")[1].strip().split()[0]
68
+ # Compare with known arguments
69
+ options = [action.option_strings for action in self._actions]
70
+ options = [opt for sublist in options for opt in sublist] # flatten
71
+ suggestion = difflib.get_close_matches(bad_arg, options, n=1)
72
+ if suggestion:
73
+ message += f"\nDid you mean '{suggestion[0]}'?"
74
+ self.exit(2, f"{self.prog}: error: {message}\n")
75
+
63
76
  def add_argument(self, *args, **kwargs) -> configargparse.Action:
64
77
  """
65
78
  This method supports the same args as ArgumentParser.add_argument(..)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: locust
3
- Version: 2.40.6.dev1
3
+ Version: 2.40.6.dev4
4
4
  Summary: Developer-friendly load testing framework
5
5
  Project-URL: homepage, https://locust.io/
6
6
  Project-URL: repository, https://github.com/locustio/locust
@@ -1,7 +1,7 @@
1
1
  locust/__init__.py,sha256=HadpgGidiyCDPSKwkxrk1Qw6eB7dTmftNJVftuJzAiw,1876
2
2
  locust/__main__.py,sha256=vBQ82334kX06ImDbFlPFgiBRiLIinwNk3z8Khs6hd74,31
3
- locust/_version.py,sha256=ux9np6_USloxEvt-wTpCC8pryGWS_ecs-F-ElFwMV9Q,719
4
- locust/argument_parser.py,sha256=t6mAoK9u13DxC9UH-alVqS6fFABFTyNWSJG89yQ4QQQ,33056
3
+ locust/_version.py,sha256=tF7jMNX12XdV36Bd_AMFCh51Wl_oVetzNr3DO1dqRww,719
4
+ locust/argument_parser.py,sha256=sIKMFvvtj3JDNJgJB5LYJ8bJ_psALopjps45ef6a1p4,33716
5
5
  locust/clients.py,sha256=OfMTOT3LwijczdL3u6bpDwDNM2TDcPCIwXBelizPOyw,20776
6
6
  locust/debug.py,sha256=7CCm8bIg44uGH2wqBlo1rXBzV2VzwPicLxLewz8r5CQ,5099
7
7
  locust/dispatch.py,sha256=prdwtb9EoN4A9klgiKgWuwQmvFB8hEuFHOK6ot62AJI,16202
@@ -56,8 +56,8 @@ locust/webui/dist/assets/terminal.gif,sha256=iw80LO2u0dnf4wpGfFJZauBeKTcSpw9iUfI
56
56
  locust/webui/dist/assets/testruns-dark.png,sha256=G4p2VZSBuuqF4neqUaPSshIp5OKQJ_Bvb69Luj6XuVs,125231
57
57
  locust/webui/dist/assets/testruns-light.png,sha256=JinGDiiBPOkhpfF-XCbmQqhRInqItrjrBTLKt5MlqVI,130301
58
58
  pytest_locust/plugin.py,sha256=WAyiRHLynXegbbX2DxIutPKO4PQRT6JdBFA7zbbaJgM,1469
59
- locust-2.40.6.dev1.dist-info/METADATA,sha256=g4DUR7vlaUPOa5p8lZLRX7zcg6hZ_sSccnr0wGasIWY,9515
60
- locust-2.40.6.dev1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
61
- locust-2.40.6.dev1.dist-info/entry_points.txt,sha256=0uIHcQ71R1qaWhM_sd8uBUCCJgp7gJfGHUVMnJeZfcY,86
62
- locust-2.40.6.dev1.dist-info/licenses/LICENSE,sha256=5hnz-Vpj0Z3kSCQl0LzV2hT1TLc4LHcbpBp3Cy-EuyM,1110
63
- locust-2.40.6.dev1.dist-info/RECORD,,
59
+ locust-2.40.6.dev4.dist-info/METADATA,sha256=0YZ2JYL8ewdWWeyVPF-wqgJkBU8Pp6uOLQwxW5pxodA,9515
60
+ locust-2.40.6.dev4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
61
+ locust-2.40.6.dev4.dist-info/entry_points.txt,sha256=0uIHcQ71R1qaWhM_sd8uBUCCJgp7gJfGHUVMnJeZfcY,86
62
+ locust-2.40.6.dev4.dist-info/licenses/LICENSE,sha256=5hnz-Vpj0Z3kSCQl0LzV2hT1TLc4LHcbpBp3Cy-EuyM,1110
63
+ locust-2.40.6.dev4.dist-info/RECORD,,