mirror of
https://github.com/httprunner/httprunner.git
synced 2026-07-11 07:22:33 +08:00
fix: ImportError when locustio is not installed
This commit is contained in:
@@ -11,6 +11,7 @@
|
|||||||
**Bugfixes**
|
**Bugfixes**
|
||||||
|
|
||||||
- fix extend with testcase reference in format version 2
|
- fix extend with testcase reference in format version 2
|
||||||
|
- fix ImportError when locustio is not installed
|
||||||
|
|
||||||
## 2.2.0 (2019-06-24)
|
## 2.2.0 (2019-06-24)
|
||||||
|
|
||||||
|
|||||||
@@ -91,14 +91,12 @@ def main_hrun():
|
|||||||
def main_locust():
|
def main_locust():
|
||||||
""" Performance test with locust: parse command line options and run commands.
|
""" Performance test with locust: parse command line options and run commands.
|
||||||
"""
|
"""
|
||||||
# monkey patch ssl at beginning to avoid RecursionError when running locust.
|
|
||||||
from gevent import monkey; monkey.patch_ssl()
|
|
||||||
|
|
||||||
import multiprocessing
|
|
||||||
import sys
|
|
||||||
from httprunner import logger
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
# monkey patch ssl at beginning to avoid RecursionError when running locust.
|
||||||
|
from gevent import monkey; monkey.patch_ssl()
|
||||||
|
import multiprocessing
|
||||||
|
import sys
|
||||||
|
from httprunner import logger
|
||||||
from httprunner import locusts
|
from httprunner import locusts
|
||||||
except ImportError:
|
except ImportError:
|
||||||
msg = "Locust is not installed, install first and try again.\n"
|
msg = "Locust is not installed, install first and try again.\n"
|
||||||
|
|||||||
Reference in New Issue
Block a user