mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-12 02:21:29 +08:00
add parser argument failfast
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user