From c061265d9ed7267db0b452156fed7670943a1c01 Mon Sep 17 00:00:00 2001 From: debugtalk Date: Wed, 2 Aug 2017 15:32:50 +0800 Subject: [PATCH] add parser argument failfast --- README.md | 6 ++++-- ate/cli.py | 5 ++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index fcb4df0d..90910477 100644 --- a/README.md +++ b/README.md @@ -45,8 +45,9 @@ Execute the command `ate -h` to view command help. ```text $ ate -h -usage: ate [-h] [-V] [--log-level LOG_LEVEL] [--report-name REPORT_NAME] - [testset_paths [testset_paths ...]] +usage: main.py [-h] [-V] [--log-level LOG_LEVEL] [--report-name REPORT_NAME] + [--failfast] + [testset_paths [testset_paths ...]] Api Test Engine. @@ -60,6 +61,7 @@ optional arguments: Specify logging level, default is INFO. --report-name REPORT_NAME Specify report name, default is generated time. + --failfast Stop the test run on the first error or failure. ``` ## Write testcases diff --git a/ate/cli.py b/ate/cli.py index cd89904a..1eab971d 100644 --- a/ate/cli.py +++ b/ate/cli.py @@ -24,6 +24,9 @@ def main(): parser.add_argument( '--report-name', help="Specify report name, default is generated time.") + parser.add_argument( + '--failfast', action='store_true', default=False, + help="Stop the test run on the first error or failure.") args = parser.parse_args() @@ -49,6 +52,6 @@ def main(): kwargs = { "output": output_folder_name, "report_name": report_name, - "failfast": True + "failfast": args.failfast } PyUnitReport.HTMLTestRunner(**kwargs).run(task_suite)