mirror of
https://github.com/httprunner/httprunner.git
synced 2026-07-10 23:12:41 +08:00
logging with colors
This commit is contained in:
@@ -3,9 +3,11 @@ import multiprocessing
|
||||
import os
|
||||
import sys
|
||||
|
||||
from httprunner.testcase import load_test_file
|
||||
from locust.main import main
|
||||
|
||||
from .logger import color_print
|
||||
from .testcase import load_test_file
|
||||
|
||||
|
||||
def parse_locustfile(file_path):
|
||||
""" parse testcase file and return locustfile path.
|
||||
@@ -13,7 +15,7 @@ def parse_locustfile(file_path):
|
||||
if file_path is a YAML/JSON file, convert it to locustfile
|
||||
"""
|
||||
if not os.path.isfile(file_path):
|
||||
print("file path invalid, exit.")
|
||||
color_print("file path invalid, exit.", "RED")
|
||||
sys.exit(1)
|
||||
|
||||
file_suffix = os.path.splitext(file_path)[1]
|
||||
@@ -23,7 +25,7 @@ def parse_locustfile(file_path):
|
||||
locustfile_path = gen_locustfile(file_path)
|
||||
else:
|
||||
# '' or other suffix
|
||||
print("file type should be YAML/JSON/Python, exit.")
|
||||
color_print("file type should be YAML/JSON/Python, exit.", "RED")
|
||||
sys.exit(1)
|
||||
|
||||
return locustfile_path
|
||||
|
||||
Reference in New Issue
Block a user