mirror of
https://github.com/httprunner/httprunner.git
synced 2026-06-14 04:09:38 +08:00
display exception stage when exception occured #367
This commit is contained in:
@@ -8,8 +8,8 @@ import unittest
|
||||
|
||||
from httprunner import logger
|
||||
from httprunner.__about__ import __description__, __version__
|
||||
from httprunner.compat import is_py2
|
||||
from httprunner.api import HttpRunner
|
||||
from httprunner.compat import is_py2
|
||||
from httprunner.utils import (create_scaffold, get_python2_retire_msg,
|
||||
prettify_json_file, validate_json_file)
|
||||
|
||||
@@ -78,7 +78,15 @@ def main_hrun():
|
||||
create_scaffold(project_path)
|
||||
exit(0)
|
||||
|
||||
runner = HttpRunner(failfast=args.failfast, dot_env_path=args.dot_env_path).run(args.testset_paths)
|
||||
try:
|
||||
runner = HttpRunner(
|
||||
failfast=args.failfast,
|
||||
dot_env_path=args.dot_env_path
|
||||
)
|
||||
runner.run(args.testset_paths)
|
||||
except Exception:
|
||||
logger.log_error("!!!!!!!!!! exception stage: {} !!!!!!!!!!".format(runner.exception_stage))
|
||||
raise
|
||||
|
||||
if not args.no_html_report:
|
||||
runner.gen_html_report(
|
||||
|
||||
Reference in New Issue
Block a user