add parser argument failfast

This commit is contained in:
debugtalk
2017-08-02 15:32:50 +08:00
parent 14e744c962
commit c061265d9e
2 changed files with 8 additions and 3 deletions

View File

@@ -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

View File

@@ -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)