mirror of
https://github.com/httprunner/httprunner.git
synced 2026-07-09 22:44:05 +08:00
fix: session data in step_datas
This commit is contained in:
@@ -1,5 +1,3 @@
|
|||||||
# encoding: utf-8
|
|
||||||
|
|
||||||
import time
|
import time
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
@@ -11,7 +9,7 @@ from requests.exceptions import (InvalidSchema, InvalidURL, MissingSchema,
|
|||||||
|
|
||||||
from httprunner import response
|
from httprunner import response
|
||||||
from httprunner.utils import lower_dict_keys, omit_long_data
|
from httprunner.utils import lower_dict_keys, omit_long_data
|
||||||
from httprunner.v3.schema import SessionData, RequestStat
|
from httprunner.v3.schema import SessionData
|
||||||
|
|
||||||
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
|
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
|
||||||
|
|
||||||
@@ -103,13 +101,13 @@ class HttpSession(requests.Session):
|
|||||||
"""
|
"""
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super(HttpSession, self).__init__()
|
super(HttpSession, self).__init__()
|
||||||
self.data = SessionData()
|
self.data = None
|
||||||
|
|
||||||
def init_session_data(self):
|
def init_session_data(self):
|
||||||
""" initialize session data, it will store detail data of request and response
|
""" initialize session data, it will store detail data of request and response
|
||||||
"""
|
"""
|
||||||
self.data.name = ""
|
self.data = SessionData(
|
||||||
self.data.req_resp = [
|
req_resp=[
|
||||||
{
|
{
|
||||||
"request": {
|
"request": {
|
||||||
"url": "N/A",
|
"url": "N/A",
|
||||||
@@ -124,8 +122,7 @@ class HttpSession(requests.Session):
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
self.data.validators = {}
|
)
|
||||||
self.data.stat = RequestStat()
|
|
||||||
|
|
||||||
def update_last_req_resp_record(self, resp_obj):
|
def update_last_req_resp_record(self, resp_obj):
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user