mirror of
https://github.com/httprunner/httprunner.git
synced 2026-08-27 11:10:31 +08:00
fix ModuleNotFoundError in debugging mode if httprunner uninstalled
This commit is contained in:
@@ -5,6 +5,7 @@
|
|||||||
**Fixed**
|
**Fixed**
|
||||||
|
|
||||||
- fix #658: sys.exit 1 if any testcase failed
|
- fix #658: sys.exit 1 if any testcase failed
|
||||||
|
- fix ModuleNotFoundError in debugging mode if httprunner uninstalled
|
||||||
|
|
||||||
## 2.2.4 (2019-07-18)
|
## 2.2.4 (2019-07-18)
|
||||||
|
|
||||||
|
|||||||
@@ -186,9 +186,12 @@ if __name__ == "__main__":
|
|||||||
""" debugging mode
|
""" debugging mode
|
||||||
"""
|
"""
|
||||||
import sys
|
import sys
|
||||||
|
import os
|
||||||
|
|
||||||
if len(sys.argv) == 0:
|
if len(sys.argv) == 0:
|
||||||
exit(0)
|
exit(0)
|
||||||
|
|
||||||
|
sys.path.insert(0, os.getcwd())
|
||||||
cmd = sys.argv.pop(1)
|
cmd = sys.argv.pop(1)
|
||||||
|
|
||||||
if cmd in ["hrun", "httprunner", "ate"]:
|
if cmd in ["hrun", "httprunner", "ate"]:
|
||||||
@@ -200,7 +203,7 @@ if __name__ == "__main__":
|
|||||||
color_print("Miss debugging type.", "RED")
|
color_print("Miss debugging type.", "RED")
|
||||||
example = "\n".join([
|
example = "\n".join([
|
||||||
"e.g.",
|
"e.g.",
|
||||||
"python main-debug.py hrun /path/to/testcase_file",
|
"python -m httprunner.cli hrun /path/to/testcase_file",
|
||||||
"python main-debug.py locusts -f /path/to/testcase_file"
|
"python -m httprunner.cli locusts -f /path/to/testcase_file"
|
||||||
])
|
])
|
||||||
color_print(example, "yellow")
|
color_print(example, "yellow")
|
||||||
|
|||||||
Reference in New Issue
Block a user