при запуске locust -f /desktop/locustfile.py
возникает следующая ошибка
[2020-06-18 12:09:27,858] fatima/INFO/locust.main: Starting web monitor at *:8089
[2020-06-18 12:09:27,858] fatima/ERROR/stderr: Traceback (most recent call last):
[2020-06-18 12:09:27,858] fatima/ERROR/stderr: File "/home/fatima/.local/bin/locust", line 11, in <module>
[2020-06-18 12:09:27,858] fatima/ERROR/stderr:
[2020-06-18 12:09:27,858] fatima/ERROR/stderr: sys.exit(main())
[2020-06-18 12:09:27,858] fatima/ERROR/stderr: File "/home/fatima/.local/lib/python2.7/site-packages/locust/main.py", line 525, in main
[2020-06-18 12:09:27,858] fatima/ERROR/stderr:
[2020-06-18 12:09:27,858] fatima/ERROR/stderr: gevent.signal(signal.SIGTERM, sig_term_handler)
[2020-06-18 12:09:27,859] fatima/ERROR/stderr: TypeError
[2020-06-18 12:09:27,859] fatima/ERROR/stderr: :
[2020-06-18 12:09:27,859] fatima/ERROR/stderr: 'module' object is not callable
[2020-06-18 12:09:27,859] fatima/ERROR/stderr:
Я использую python: 3,7 , саранча 0,13,0 и вот код
import random
from locust import HttpLocust, TaskSet, between
products = [
'0PUK6V6EV0',
'1YMWWN1N4O',
'2ZYFJ3GM2N',
'66VCHSJNUP',
'6E92ZMYYFZ',
'9SIQT8TOJO',
'L9ECAV7KIM',
'LS4PSXUNUM',
'OLJCESPC7Z']
def index(l):
l.client.get("/")
def setCurrency(l):
currencies = ['EUR', 'USD', 'JPY', 'CAD']
l.client.post("/setCurrency",
{'currency_code': random.choice(currencies)})
def browseProduct(l):
l.client.get("/product/" + random.choice(products))
class UserBehavior(TaskSet):
def on_start(self):
index(self)
tasks = {index: 1,
setCurrency: 2,
browseProduct: 10,
}
class WebsiteUser(HttpLocust):
task_set = UserBehavior
wait_time = between(1, 10)
я запускаю документацию locust 0.13.0 example , и он также дает мне ту же ошибку. Я подумал, что это может быть проблема с версией python, поэтому я устанавливаю python 2.7 и снова запускаю locust, но все равно ошибка.