mirror of
https://github.com/httprunner/httprunner.git
synced 2026-09-05 07:26:55 +08:00
bump version to 3.0.4
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
__version__ = "3.0.3"
|
__version__ = "3.0.4"
|
||||||
__description__ = "One-stop solution for HTTP(S) testing."
|
__description__ = "One-stop solution for HTTP(S) testing."
|
||||||
|
|
||||||
from httprunner.runner import HttpRunner
|
from httprunner.runner import HttpRunner
|
||||||
|
|||||||
@@ -195,10 +195,6 @@ class HttpSession(requests.Session):
|
|||||||
Safe mode has been removed from requests 1.x.
|
Safe mode has been removed from requests 1.x.
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
msg = "processed request:\n"
|
|
||||||
msg += f"> {method} {url}\n"
|
|
||||||
msg += f"> kwargs: {kwargs}"
|
|
||||||
logger.debug(msg)
|
|
||||||
return requests.Session.request(self, method, url, **kwargs)
|
return requests.Session.request(self, method, url, **kwargs)
|
||||||
except (MissingSchema, InvalidSchema, InvalidURL):
|
except (MissingSchema, InvalidSchema, InvalidURL):
|
||||||
raise
|
raise
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ def convert_testcase_path(testcase_path: Text) -> Tuple[Text, Text]:
|
|||||||
|
|
||||||
|
|
||||||
def format_pytest_with_black(python_paths: List[Text]):
|
def format_pytest_with_black(python_paths: List[Text]):
|
||||||
logger.info("format pytest case with black ...")
|
logger.info("format pytest cases with black ...")
|
||||||
try:
|
try:
|
||||||
subprocess.run(["black", *python_paths])
|
subprocess.run(["black", *python_paths])
|
||||||
except subprocess.CalledProcessError as ex:
|
except subprocess.CalledProcessError as ex:
|
||||||
|
|||||||
@@ -164,6 +164,8 @@ class ResponseObject(object):
|
|||||||
|
|
||||||
# check item
|
# check item
|
||||||
check_item = u_validator["check"]
|
check_item = u_validator["check"]
|
||||||
|
# TODO: validate variable or function
|
||||||
|
# check_item = parse_data(check_item, variables_mapping, functions_mapping)
|
||||||
check_value = jmespath.search(check_item, self.resp_obj_meta)
|
check_value = jmespath.search(check_item, self.resp_obj_meta)
|
||||||
check_value = parse_string_value(check_value)
|
check_value = parse_string_value(check_value)
|
||||||
|
|
||||||
|
|||||||
@@ -65,12 +65,8 @@ class HttpRunner(object):
|
|||||||
method = parsed_request_dict.pop("method")
|
method = parsed_request_dict.pop("method")
|
||||||
url_path = parsed_request_dict.pop("url")
|
url_path = parsed_request_dict.pop("url")
|
||||||
url = build_url(self.config.base_url, url_path)
|
url = build_url(self.config.base_url, url_path)
|
||||||
|
|
||||||
parsed_request_dict["json"] = parsed_request_dict.pop("req_json", {})
|
parsed_request_dict["json"] = parsed_request_dict.pop("req_json", {})
|
||||||
|
|
||||||
logger.info(f"{method} {url}")
|
|
||||||
logger.debug(f"request kwargs(raw): {parsed_request_dict}")
|
|
||||||
|
|
||||||
# request
|
# request
|
||||||
self.__session = self.__session or HttpSession()
|
self.__session = self.__session or HttpSession()
|
||||||
resp = self.__session.request(method, url, **parsed_request_dict)
|
resp = self.__session.request(method, url, **parsed_request_dict)
|
||||||
@@ -148,7 +144,7 @@ class HttpRunner(object):
|
|||||||
|
|
||||||
def __run_step(self, step: TStep):
|
def __run_step(self, step: TStep):
|
||||||
"""run teststep, teststep maybe a request or referenced testcase"""
|
"""run teststep, teststep maybe a request or referenced testcase"""
|
||||||
logger.info(f"run step: {step.name}")
|
logger.info(f"run step begin: {step.name} >>>>>>")
|
||||||
|
|
||||||
if step.request:
|
if step.request:
|
||||||
step_data = self.__run_step_request(step)
|
step_data = self.__run_step_request(step)
|
||||||
@@ -160,6 +156,7 @@ class HttpRunner(object):
|
|||||||
)
|
)
|
||||||
|
|
||||||
self.__step_datas.append(step_data)
|
self.__step_datas.append(step_data)
|
||||||
|
logger.info(f"run step end: {step.name} <<<<<<\n")
|
||||||
return step_data.export
|
return step_data.export
|
||||||
|
|
||||||
def run(self, testcase: TestCase):
|
def run(self, testcase: TestCase):
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "httprunner"
|
name = "httprunner"
|
||||||
version = "3.0.3"
|
version = "3.0.4"
|
||||||
description = "One-stop solution for HTTP(S) testing."
|
description = "One-stop solution for HTTP(S) testing."
|
||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
|
|||||||
Reference in New Issue
Block a user