(add_help=True, default_config_files=DEFAULT_CONFIG_FILES)
| 217 | |
| 218 | |
| 219 | def get_empty_argument_parser(add_help=True, default_config_files=DEFAULT_CONFIG_FILES) -> LocustArgumentParser: |
| 220 | parser = LocustArgumentParser( |
| 221 | default_config_files=default_config_files, |
| 222 | config_file_parser_class=LocustConfigParser, |
| 223 | add_env_var_help=False, |
| 224 | add_config_file_help=False, |
| 225 | add_help=add_help, |
| 226 | formatter_class=configargparse.RawDescriptionHelpFormatter, |
| 227 | usage=configargparse.SUPPRESS, |
| 228 | description=textwrap.dedent( |
| 229 | """ |
| 230 | Usage: locust [options] [UserClass ...] |
| 231 | """ |
| 232 | ), |
| 233 | epilog="""Examples: |
| 234 | |
| 235 | locust -f my_test.py -H https://www.example.com |
| 236 | |
| 237 | locust --headless -u 100 -t 20m --processes 4 MyHttpUser AnotherUser |
| 238 | |
| 239 | locust --headless -u 100 -r 10 -t 50 --print-stats --html "test_report_{u}_{r}_{t}.html" |
| 240 | (The above run would generate an html file with the name "test_report_100_10_50.html") |
| 241 | |
| 242 | See documentation for more details, including how to set options using a file or environment variables: https://docs.locust.io/en/stable/configuration.html""", |
| 243 | ) |
| 244 | parser.add_argument( |
| 245 | "-f", |
| 246 | "--locustfile", |
| 247 | metavar="<filename>", |
| 248 | default="locustfile.py", |
| 249 | help="The Python file or module that contains your test, e.g. 'my_test.py'. Accepts multiple comma-separated .py files, a package name/directory or a url to a remote locustfile. Defaults to 'locustfile.py'.", |
| 250 | env_var="LOCUST_LOCUSTFILE", |
| 251 | ) |
| 252 | |
| 253 | parser.add_argument( |
| 254 | "--config", |
| 255 | is_config_file_arg=True, |
| 256 | help="File to read additional configuration from. See https://docs.locust.io/en/stable/configuration.html#configuration-file", |
| 257 | metavar="<filename>", |
| 258 | ) |
| 259 | |
| 260 | return parser |
| 261 | |
| 262 | |
| 263 | def download_locustfile_from_master(master_host: str, master_port: int) -> str: |
no test coverage detected
searching dependent graphs…