Save loaded tests and parsed tests to JSON file.

This commit is contained in:
debugtalk
2018-11-22 21:48:03 +08:00
parent b810ad7e91
commit 7d9ffb097f
3 changed files with 57 additions and 27 deletions

View File

@@ -45,6 +45,9 @@ def main_hrun():
parser.add_argument(
'--failfast', action='store_true', default=False,
help="Stop the test run on the first error or failure.")
parser.add_argument(
'--save-tests', action='store_true', default=False,
help="Save loaded tests and parsed tests to JSON file.")
parser.add_argument(
'--startproject',
help="Specify new project name.")
@@ -80,7 +83,11 @@ def main_hrun():
for path in args.testcase_paths:
try:
runner = HttpRunner(failfast=args.failfast)
runner.run(path, dot_env_path=args.dot_env_path)
runner.run(
path,
dot_env_path=args.dot_env_path,
save_tests=args.save_tests
)
except Exception:
logger.log_error("!!!!!!!!!! exception stage: {} !!!!!!!!!!".format(runner.exception_stage))
raise