Commit Graph

30 Commits

Author SHA1 Message Date
Шпак Андрей Сергеевич a8302fc4b5 Code quality: Fix unused imports and switch on related ruff check 2025-01-19 09:36:12 +03:00
tdadela f99e9df700 sort imports 2024-01-17 00:07:29 +01:00
Lars Holmberg 6ec972f4db Ran pyupgrade on the code base, removing various "Python2-isms". 2022-02-25 15:06:08 +01:00
Dennis Kroné e18c175112 Cleanup code and fix faulty comments. 2021-04-26 13:58:12 +02:00
Dennis Kroné 81cbeb9c15 Update tests and examples for the new request event. 2021-04-21 16:24:44 +02:00
Jonatan Heyman 03b6df4fab Re-add info on wait_time to Quickstart documentation and examples 2020-11-18 14:20:49 +01:00
Lars Holmberg 7676b5389c Make wait_time = constant(0) the default instead of forcing our users to specify it. Makes a big difference in readability of small User classes and reduces the cognitive overhead for locust beginners. Fixes #1308 2020-11-11 22:14:20 +01:00
Lars Holmberg 8ee87dd000 Fix various linting issues (mostly trailing whitespaces & whitespace in newlines) 2020-08-27 23:19:13 +02:00
Lars Holmberg 7c0fcc213d Auto format using Black (20.8b1, which includes the magic trailing commas fix). Added black --check to build. 2020-08-27 09:17:42 +02:00
Phil Davis 05855d8ea0 Fix typos 2020-08-10 21:19:44 +05:45
anuj_ 530db29ad7 More renaming. Includes renaming in test and example files as well. 2020-04-20 13:52:22 +12:00
Jonatan Heyman 9b80b7edf6 Access WebUI instance through environment 2020-04-14 20:36:36 +02:00
Jonatan Heyman ca349d88d7 Merge branch 'master' into tasks-directly-under-locust-class 2020-04-01 01:50:22 +02:00
Jonatan Heyman 02ce1665b4 Change how tasks and TaskSets are declared on Locust classes.
* Let users specify tasks directly under a Locust class, just as one would do it on a TaskSet class. These tasks will get the Locust instance as argument when executed.
* Removed Locust.task_set from the public API, and instead let users use either the tasks attribute or the @task decorator.
* Introduce a Locust.abstract boolean attribute. If it's set to True the Locust class is meant to be used as a base class, and users of that type can not be spawned directly from it.
2020-04-01 01:08:07 +02:00
Anuj Sharma 8514d6f1cf Rename slave to worker (except changelog) 2020-03-29 14:13:29 +13:00
Jonatan Heyman f6715f5562 Rename locust.events module to locust.event
Introduce global instance of Events() stored in locust.events which can be used to register event listeners at the module level of locustfiles.
Remove some unused imports.
2020-03-03 19:43:34 +01:00
Jonatan Heyman 8a1f4b5fd9 Update example (event arguments was changed) 2020-03-03 16:23:02 +01:00
Jonatan Heyman 5a7704cc72 Add locust.event.init event hook that can be used by end-users to run code that is dependent on the Environment instance (e.g. to set up request_success/request_failure listeners).
Update examples/events.py to use the new API.
2020-02-27 14:23:11 +01:00
Jonatan Heyman cc1d379c71 Updated examples files to use new wait_time API 2019-10-24 17:50:19 +02:00
Mark Beacom 8f94de560d Merge branch 'master' into sort-imports 2017-09-08 12:18:26 -04:00
Mark Beacom 700982299c
Standardize utf8 file coding declarations 2017-09-08 04:00:05 -04:00
Mark Beacom 532fec806b
Sort all python imports 2017-09-08 03:47:06 -04:00
Russell Horton 17afba903a typos 2014-07-22 15:40:16 -07:00
Nawaid Shamim 2c1bee6143 removed global keywords 2014-05-16 11:57:48 +01:00
Nawaid Shamim 2c6e6c032b Fixing scope of variables in event handler function 2014-05-16 11:07:18 +01:00
Nawaid Shamim 53de0910a1 Fixing typos in events example 2014-05-15 13:31:44 +01:00
Jonatan Heyman 4ca0eef585 Event hook functions are now always called with keyword arguments
This makes it easier for us to add new arguments to events in the future, with less risk of breaking people's code (as long as they've used a **kw wildcard argument in their event listeners)
2013-12-02 21:34:18 +01:00
Jonatan Heyman 7ed9f5f215 Moved HttpSession instantiation into new HttpLocust class
As discussed in #83, removed HttpSession instantiation on the Locust.client attribute from base Locust class, and introduced new HttpLocust class with this functionality. 

Added warning when trying to access the client attribute on a "bare" Locust instance. Updated documentation.
2013-12-02 08:48:52 +01:00
Joakim Hamren 6762242ad3 Fixed broken example (events.py) 2013-11-29 14:54:54 +01:00
Jonatan Heyman 0ca0af4095 Added an example locust file that uses locust's built in events to track some extra statistics 2012-03-20 02:43:33 +01:00