mirror of
https://github.com/httprunner/httprunner.git
synced 2026-09-05 07:26:55 +08:00
fix: log error when parse failed
This commit is contained in:
@@ -7,6 +7,7 @@ import json
|
|||||||
import re
|
import re
|
||||||
|
|
||||||
from httprunner import exceptions, utils, loader
|
from httprunner import exceptions, utils, loader
|
||||||
|
from httprunner import logger
|
||||||
from httprunner.compat import basestring, numeric_types, str
|
from httprunner.compat import basestring, numeric_types, str
|
||||||
|
|
||||||
# use $$ to escape $ notation
|
# use $$ to escape $ notation
|
||||||
@@ -1242,10 +1243,12 @@ def _parse_testcase(testcase, project_mapping, session_variables_set=None):
|
|||||||
"config": prepared_config,
|
"config": prepared_config,
|
||||||
"teststeps": prepared_testcase_tests
|
"teststeps": prepared_testcase_tests
|
||||||
}
|
}
|
||||||
except (exceptions.MyBaseFailure, exceptions.MyBaseError):
|
except (exceptions.MyBaseFailure, exceptions.MyBaseError) as ex:
|
||||||
testcase_type = testcase["type"]
|
testcase_type = testcase["type"]
|
||||||
testcase_path = testcase.get("path")
|
testcase_path = testcase.get("path")
|
||||||
|
|
||||||
|
logger.log_error("failed to parse testcase: {}, error: {}".format(testcase_path, ex))
|
||||||
|
|
||||||
global parse_failed_testfiles
|
global parse_failed_testfiles
|
||||||
if testcase_type not in parse_failed_testfiles:
|
if testcase_type not in parse_failed_testfiles:
|
||||||
parse_failed_testfiles[testcase_type] = []
|
parse_failed_testfiles[testcase_type] = []
|
||||||
|
|||||||
Reference in New Issue
Block a user