mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-12 11:29:48 +08:00
specify logging level from CLI
This commit is contained in:
@@ -9,8 +9,6 @@ from requests.exceptions import (InvalidSchema, InvalidURL, MissingSchema,
|
||||
|
||||
from ate.exception import ParamsError
|
||||
|
||||
log_level = getattr(logging, "INFO")
|
||||
logging.basicConfig(level=log_level)
|
||||
absolute_http_url_regexp = re.compile(r"^https?://", re.I)
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import argparse
|
||||
import logging
|
||||
import unittest
|
||||
|
||||
from ate import runner, utils
|
||||
@@ -56,7 +57,14 @@ def main():
|
||||
parser.add_argument(
|
||||
'--testcase-path', default='testcases',
|
||||
help="testcase file path")
|
||||
parser.add_argument(
|
||||
'--log-level', default='INFO',
|
||||
help="Specify logging level, default is INFO.")
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
log_level = getattr(logging, args.log_level.upper())
|
||||
logging.basicConfig(level=log_level)
|
||||
|
||||
task_suite = create_task(args.testcase_path)
|
||||
unittest.TextTestRunner().run(task_suite)
|
||||
|
||||
Reference in New Issue
Block a user