change: add httprunner version in generated pytest file

This commit is contained in:
debugtalk
2020-06-04 10:35:23 +08:00
parent cc83ac9853
commit 00b437620d
14 changed files with 16 additions and 15 deletions

View File

@@ -1,4 +1,4 @@
# NOTICE: Generated By HttpRunner.
# NOTICE: Generated By HttpRunner v3.0.7
# FROM: examples/httpbin/basic.yml
from httprunner import HttpRunner, Config, Step, RunRequest, RunTestCase

View File

@@ -1,4 +1,4 @@
# NOTICE: Generated By HttpRunner.
# NOTICE: Generated By HttpRunner v3.0.7
# FROM: examples/httpbin/hooks.yml
from httprunner import HttpRunner, Config, Step, RunRequest, RunTestCase

View File

@@ -1,4 +1,4 @@
# NOTICE: Generated By HttpRunner.
# NOTICE: Generated By HttpRunner v3.0.7
# FROM: examples/httpbin/load_image.yml
from httprunner import HttpRunner, Config, Step, RunRequest, RunTestCase

View File

@@ -1,4 +1,4 @@
# NOTICE: Generated By HttpRunner.
# NOTICE: Generated By HttpRunner v3.0.7
# FROM: examples/httpbin/upload.yml
from httprunner import HttpRunner, Config, Step, RunRequest, RunTestCase

View File

@@ -1,4 +1,4 @@
# NOTICE: Generated By HttpRunner.
# NOTICE: Generated By HttpRunner v3.0.7
# FROM: examples/httpbin/validate.yml
from httprunner import HttpRunner, Config, Step, RunRequest, RunTestCase

View File

@@ -1,4 +1,4 @@
# NOTICE: Generated By HttpRunner.
# NOTICE: Generated By HttpRunner v3.0.7
# FROM: examples/postman_echo/request_methods/request_with_functions.yml
from httprunner import HttpRunner, Config, Step, RunRequest, RunTestCase

View File

@@ -1,4 +1,4 @@
# NOTICE: Generated By HttpRunner.
# NOTICE: Generated By HttpRunner v3.0.7
# FROM: examples/postman_echo/request_methods/request_with_testcase_reference.yml
import os

View File

@@ -1,4 +1,4 @@
# NOTICE: Generated By HttpRunner.
# NOTICE: Generated By HttpRunner v3.0.7
# FROM: examples/postman_echo/request_methods/hardcode.yml
from httprunner import HttpRunner, Config, Step, RunRequest, RunTestCase

View File

@@ -1,4 +1,4 @@
# NOTICE: Generated By HttpRunner.
# NOTICE: Generated By HttpRunner v3.0.7
# FROM: examples/postman_echo/request_methods/request_with_functions.yml
from httprunner import HttpRunner, Config, Step, RunRequest, RunTestCase

View File

@@ -1,4 +1,4 @@
# NOTICE: Generated By HttpRunner.
# NOTICE: Generated By HttpRunner v3.0.7
# FROM: examples/postman_echo/request_methods/request_with_testcase_reference.yml
import os

View File

@@ -1,4 +1,4 @@
# NOTICE: Generated By HttpRunner.
# NOTICE: Generated By HttpRunner v3.0.7
# FROM: examples/postman_echo/request_methods/request_with_variables.yml
from httprunner import HttpRunner, Config, Step, RunRequest, RunTestCase

View File

@@ -1,4 +1,4 @@
# NOTICE: Generated By HttpRunner.
# NOTICE: Generated By HttpRunner v3.0.7
# FROM: examples/postman_echo/request_methods/validate_with_functions.yml
from httprunner import HttpRunner, Config, Step, RunRequest, RunTestCase

View File

@@ -1,4 +1,4 @@
# NOTICE: Generated By HttpRunner.
# NOTICE: Generated By HttpRunner v3.0.7
# FROM: examples/postman_echo/request_methods/validate_with_variables.yml
from httprunner import HttpRunner, Config, Step, RunRequest, RunTestCase

View File

@@ -6,7 +6,7 @@ from typing import Text, List, Tuple, Dict, Set, NoReturn
import jinja2
from loguru import logger
from httprunner import exceptions
from httprunner import exceptions, __version__
from httprunner.compat import ensure_testcase_v3_api, ensure_testcase_v3
from httprunner.loader import (
load_folder_files,
@@ -24,7 +24,7 @@ make_files_cache_set: Set = set()
pytest_files_set: Set = set()
__TEMPLATE__ = jinja2.Template(
"""# NOTICE: Generated By HttpRunner.
"""# NOTICE: Generated By HttpRunner v{{ version }}
# FROM: {{ testcase_path }}
{% if imports_list %}
import os
@@ -298,6 +298,7 @@ def make_testcase(
)
data = {
"version": __version__,
"testcase_path": __ensure_cwd_relative(testcase_path),
"class_name": f"TestCase{testcase_cls_name}",
"imports_list": imports_list,