mirror of
https://github.com/httprunner/httprunner.git
synced 2026-09-05 15:37:35 +08:00
test: add unittest form testcase with abnormal path
This commit is contained in:
+4
-3
@@ -1,4 +1,5 @@
|
||||
import argparse
|
||||
import enum
|
||||
import os
|
||||
import sys
|
||||
|
||||
@@ -23,7 +24,7 @@ def init_parser_run(subparsers):
|
||||
return sub_parser_run
|
||||
|
||||
|
||||
def main_run(extra_args):
|
||||
def main_run(extra_args) -> enum.IntEnum:
|
||||
capture_message("start to run")
|
||||
# keep compatibility with v2
|
||||
extra_args = ensure_cli_args(extra_args)
|
||||
@@ -52,7 +53,7 @@ def main_run(extra_args):
|
||||
extra_args_new.append("--tb=short")
|
||||
|
||||
extra_args_new.extend(testcase_path_list)
|
||||
sys.exit(pytest.main(extra_args_new))
|
||||
return pytest.main(extra_args_new)
|
||||
|
||||
|
||||
def main():
|
||||
@@ -112,7 +113,7 @@ def main():
|
||||
sys.exit(0)
|
||||
|
||||
if sys.argv[1] == "run":
|
||||
main_run(extra_args)
|
||||
sys.exit(main_run(extra_args))
|
||||
elif sys.argv[1] == "startproject":
|
||||
main_scaffold(args)
|
||||
elif sys.argv[1] == "har2case":
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ pytest_files_made_cache_mapping: Dict[Text, Text] = {}
|
||||
pytest_files_run_set: Set = set()
|
||||
|
||||
__TEMPLATE__ = jinja2.Template(
|
||||
"""# NOTICE: Generated By HttpRunner v{{ version }}
|
||||
"""# NOTE: Generated By HttpRunner v{{ version }}
|
||||
# FROM: {{ testcase_path }}
|
||||
{% if imports_list %}
|
||||
import os
|
||||
|
||||
Reference in New Issue
Block a user