mirror of
https://github.com/httprunner/httprunner.git
synced 2026-09-05 15:37:35 +08:00
improvement: relocate debugging scripts
This commit is contained in:
@@ -176,3 +176,27 @@ def main_locust():
|
|||||||
locusts.run_locusts_with_processes(sys.argv, processes_count)
|
locusts.run_locusts_with_processes(sys.argv, processes_count)
|
||||||
else:
|
else:
|
||||||
locusts.start_locust_main()
|
locusts.start_locust_main()
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
""" debugging mode
|
||||||
|
"""
|
||||||
|
import sys
|
||||||
|
if len(sys.argv) == 0:
|
||||||
|
exit(0)
|
||||||
|
|
||||||
|
cmd = sys.argv.pop(1)
|
||||||
|
|
||||||
|
if cmd in ["hrun", "httprunner", "ate"]:
|
||||||
|
main_hrun()
|
||||||
|
elif cmd in ["locust", "locusts"]:
|
||||||
|
main_locust()
|
||||||
|
else:
|
||||||
|
from httprunner.logger import color_print
|
||||||
|
color_print("Miss debugging type.", "RED")
|
||||||
|
example = "\n".join([
|
||||||
|
"e.g.",
|
||||||
|
"python main-debug.py hrun /path/to/testcase_file",
|
||||||
|
"python main-debug.py locusts -f /path/to/testcase_file"
|
||||||
|
])
|
||||||
|
color_print(example, "yellow")
|
||||||
|
|||||||
@@ -1,19 +0,0 @@
|
|||||||
import sys
|
|
||||||
|
|
||||||
from httprunner.cli import main_hrun, main_locust
|
|
||||||
from httprunner.logger import color_print
|
|
||||||
|
|
||||||
cmd = sys.argv.pop(1)
|
|
||||||
|
|
||||||
if cmd in ["hrun", "httprunner", "ate"]:
|
|
||||||
main_hrun()
|
|
||||||
elif cmd in ["locust", "locusts"]:
|
|
||||||
main_locust()
|
|
||||||
else:
|
|
||||||
color_print("Miss debugging type.", "RED")
|
|
||||||
example = "\n".join([
|
|
||||||
"e.g.",
|
|
||||||
"python main-debug.py hrun /path/to/testcase_file",
|
|
||||||
"python main-debug.py locusts -f /path/to/testcase_file"
|
|
||||||
])
|
|
||||||
color_print(example, "yellow")
|
|
||||||
Reference in New Issue
Block a user