Skip to content

Commit

Permalink
Merge pull request #2285 from keegoo/fix_use_as_lib_event
Browse files Browse the repository at this point in the history
add events when initialize Environment
  • Loading branch information
cyberw authored Jan 11, 2023
2 parents 9300e7f + 592d47c commit 110986b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/use_as_lib.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import gevent
from locust import HttpUser, task
from locust import HttpUser, task, events
from locust.env import Environment
from locust.stats import stats_printer, stats_history
from locust.log import setup_logging
Expand All @@ -16,7 +16,7 @@ def t(self):


# setup Environment and Runner
env = Environment(user_classes=[MyUser])
env = Environment(user_classes=[MyUser], events=events)
runner = env.create_local_runner()

# start a WebUI instance
Expand Down

0 comments on commit 110986b

Please sign in to comment.