mirror of
https://github.com/httprunner/httprunner.git
synced 2026-09-05 15:37:35 +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
|
```text
|
||||||
$ ate -h
|
$ ate -h
|
||||||
usage: ate [-h] [-V] [--log-level LOG_LEVEL] [--report-name REPORT_NAME]
|
usage: main.py [-h] [-V] [--log-level LOG_LEVEL] [--report-name REPORT_NAME]
|
||||||
[testset_paths [testset_paths ...]]
|
[--failfast]
|
||||||
|
[testset_paths [testset_paths ...]]
|
||||||
|
|
||||||
Api Test Engine.
|
Api Test Engine.
|
||||||
|
|
||||||
@@ -60,6 +61,7 @@ optional arguments:
|
|||||||
Specify logging level, default is INFO.
|
Specify logging level, default is INFO.
|
||||||
--report-name REPORT_NAME
|
--report-name REPORT_NAME
|
||||||
Specify report name, default is generated time.
|
Specify report name, default is generated time.
|
||||||
|
--failfast Stop the test run on the first error or failure.
|
||||||
```
|
```
|
||||||
|
|
||||||
## Write testcases
|
## Write testcases
|
||||||
|
|||||||
+4
-1
@@ -24,6 +24,9 @@ def main():
|
|||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'--report-name',
|
'--report-name',
|
||||||
help="Specify report name, default is generated time.")
|
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()
|
args = parser.parse_args()
|
||||||
|
|
||||||
@@ -49,6 +52,6 @@ def main():
|
|||||||
kwargs = {
|
kwargs = {
|
||||||
"output": output_folder_name,
|
"output": output_folder_name,
|
||||||
"report_name": report_name,
|
"report_name": report_name,
|
||||||
"failfast": True
|
"failfast": args.failfast
|
||||||
}
|
}
|
||||||
PyUnitReport.HTMLTestRunner(**kwargs).run(task_suite)
|
PyUnitReport.HTMLTestRunner(**kwargs).run(task_suite)
|
||||||
|
|||||||
Reference in New Issue
Block a user