This commit is contained in:
gaoqiang 2022-09-06 10:07:31 +08:00
parent c03e033b1a
commit 0dfb5fdf49
64 changed files with 320 additions and 2 deletions

View File

@ -51,8 +51,17 @@ class RestClient():
data = complexjson.dumps(json)
return self.session.patch(url, data, **kwargs)
def request_log(self, url, method, data=None, json=None, params=None, headers=None,files=None, cookies=None, **kwargs):
def request_log(self, url, method, data=None, json=None, params=None, headers=None, files=None, cookies=None, **kwargs):
logger.info("接口请求地址 ==>> {}".format(url))
logger.info("接口请求方式 ==>> {}".format(method))
# Python3中json在做dumps操作时会将中文转换成unicode编码因此设置 ensure_ascii=False
logger.info("接口请求头 ==>> {}".format(complexjson.dumps(headers, indent=4, ensure_ascii=False)))
logger.info("接口请求 params 参数 ==>> {}".format(complexjson.dumps(params, indent=4, ensure_ascii=False)))
logger.info("接口请求体 data 参数 ==>> {}".format(complexjson.dumps(data, indent=4, ensure_ascii=False)))
logger.info("接口请求体 json 参数 ==>> {}".format(complexjson.dumps(json, indent=4, ensure_ascii=False)))
logger.info("接口上传附件 files 参数 ==>> {}".format(files))
logger.info("接口 cookies 参数 ==>> {}".format(complexjson.dumps(cookies, indent=4, ensure_ascii=False)))

6
log/20220904.log Normal file
View File

@ -0,0 +1,6 @@
[2022-09-04 21:21:36,794][read_data.py 40][INFO]: 加载 C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\config\setting.ini 文件......
[2022-09-04 21:21:36,824][read_data.py 40][INFO]: 加载 C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\config\setting.ini 文件......
[2022-09-04 21:21:37,004][read_data.py 26][INFO]: 加载 C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\data\api_test_data.yml 文件......
[2022-09-04 21:21:37,014][read_data.py 29][INFO]: 读到数据 ==>> {'test_get_all_user_info': [[True, 0, '查询成功']]}
[2022-09-04 21:21:37,154][test_01_get_user_info.py 15][INFO]: ********** 开始执行用例 **********
[2022-09-04 21:21:37,154][rest_client.py 55][INFO]: 接口请求地址 ==>> http://119.3.55.6:9999/users

57
log/20220905.log Normal file
View File

@ -0,0 +1,57 @@
[2022-09-05 10:14:20,584][read_data.py 40][INFO]: 加载 C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\config\setting.ini 文件......
[2022-09-05 10:14:20,629][read_data.py 40][INFO]: 加载 C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\config\setting.ini 文件......
[2022-09-05 10:14:20,790][read_data.py 26][INFO]: 加载 C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\data\api_test_data.yml 文件......
[2022-09-05 10:14:20,805][read_data.py 29][INFO]: 读到数据 ==>> {'test_get_all_user_info': [[True, 0, '查询成功']]}
[2022-09-05 10:14:21,020][test_01_get_user_info.py 15][INFO]: ********** 开始执行用例 **********
[2022-09-05 10:14:21,020][rest_client.py 55][INFO]: 接口请求地址 ==>> http://119.3.55.6:9999/users
[2022-09-05 10:14:57,633][read_data.py 40][INFO]: 加载 C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\config\setting.ini 文件......
[2022-09-05 10:14:57,716][read_data.py 40][INFO]: 加载 C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\config\setting.ini 文件......
[2022-09-05 10:14:57,909][read_data.py 26][INFO]: 加载 C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\data\api_test_data.yml 文件......
[2022-09-05 10:14:57,911][read_data.py 29][INFO]: 读到数据 ==>> {'test_get_all_user_info': [[True, 0, '查询成功']]}
[2022-09-05 10:14:58,062][test_01_get_user_info.py 15][INFO]: ********** 开始执行用例 **********
[2022-09-05 10:14:58,062][rest_client.py 55][INFO]: 接口请求地址 ==>> http://119.3.55.6:9999/users
[2022-09-05 10:15:14,939][read_data.py 40][INFO]: 加载 C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\config\setting.ini 文件......
[2022-09-05 10:15:15,162][read_data.py 40][INFO]: 加载 C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\config\setting.ini 文件......
[2022-09-05 10:15:15,319][read_data.py 26][INFO]: 加载 C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\data\api_test_data.yml 文件......
[2022-09-05 10:15:15,322][read_data.py 29][INFO]: 读到数据 ==>> {'test_get_all_user_info': [[True, 0, '查询成功']]}
[2022-09-05 10:15:15,394][test_01_get_user_info.py 15][INFO]: ********** 开始执行用例 **********
[2022-09-05 10:15:15,395][rest_client.py 55][INFO]: 接口请求地址 ==>> http://119.3.55.6:9999/users
[2022-09-05 10:16:43,192][read_data.py 40][INFO]: 加载 C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\config\setting.ini 文件......
[2022-09-05 10:16:43,239][read_data.py 40][INFO]: 加载 C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\config\setting.ini 文件......
[2022-09-05 10:16:43,392][read_data.py 26][INFO]: 加载 C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\data\api_test_data.yml 文件......
[2022-09-05 10:16:43,394][read_data.py 29][INFO]: 读到数据 ==>> {'test_get_all_user_info': [[True, 0, '查询成功']]}
[2022-09-05 10:16:43,575][test_01_get_user_info.py 15][INFO]: ********** 开始执行用例 **********
[2022-09-05 10:16:43,575][rest_client.py 55][INFO]: 接口请求地址 ==>> http://119.3.55.6:9999/users
[2022-09-05 10:16:43,670][test_01_get_user_info.py 18][INFO]: 接口返回 ==>>
[2022-09-05 10:17:17,557][read_data.py 40][INFO]: 加载 C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\config\setting.ini 文件......
[2022-09-05 10:17:17,581][read_data.py 40][INFO]: 加载 C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\config\setting.ini 文件......
[2022-09-05 10:17:17,752][read_data.py 26][INFO]: 加载 C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\data\api_test_data.yml 文件......
[2022-09-05 10:17:17,761][read_data.py 29][INFO]: 读到数据 ==>> {'test_get_all_user_info': [[True, 0, '查询成功']]}
[2022-09-05 10:17:17,950][test_01_get_user_info.py 15][INFO]: ********** 开始执行用例 **********
[2022-09-05 10:17:17,951][rest_client.py 55][INFO]: 接口请求地址 ==>> http://119.3.55.6:9999/users
[2022-09-05 10:19:43,175][read_data.py 40][INFO]: 加载 C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\config\setting.ini 文件......
[2022-09-05 10:19:43,247][read_data.py 40][INFO]: 加载 C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\config\setting.ini 文件......
[2022-09-05 10:19:43,441][read_data.py 26][INFO]: 加载 C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\data\api_test_data.yml 文件......
[2022-09-05 10:19:43,473][read_data.py 29][INFO]: 读到数据 ==>> {'test_get_all_user_info': [[True, 0, '查询成功']]}
[2022-09-05 10:19:43,690][test_01_get_user_info.py 15][INFO]: ********** 开始执行用例 **********
[2022-09-05 10:19:43,691][rest_client.py 55][INFO]: 接口请求地址 ==>> http://119.3.55.6:9999/users
[2022-09-05 10:20:03,858][read_data.py 40][INFO]: 加载 C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\config\setting.ini 文件......
[2022-09-05 10:20:03,883][read_data.py 40][INFO]: 加载 C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\config\setting.ini 文件......
[2022-09-05 10:20:04,056][read_data.py 26][INFO]: 加载 C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\data\api_test_data.yml 文件......
[2022-09-05 10:20:04,057][read_data.py 29][INFO]: 读到数据 ==>> {'test_get_all_user_info': [[True, 0, '查询成功']]}
[2022-09-05 10:20:04,153][test_01_get_user_info.py 15][INFO]: ********** 开始执行用例 **********
[2022-09-05 10:20:04,154][rest_client.py 55][INFO]: 接口请求地址 ==>> http://119.3.55.6:9999/users
[2022-09-05 10:20:04,238][test_01_get_user_info.py 18][INFO]: 接口返回 ==>> {'code': 0, 'data': [{'address': '上海市黄浦区', 'id': 1, 'password': '8fcde9debf630eeee3162b2b70d31082', 'role': 1, 'sex': 1, 'telephone': '13500010005', 'username': 'wintest1'}, {'address': '上海市黄浦区', 'id': 2, 'password': '699423835a085ed49cfc27cb93965149', 'role': 1, 'sex': 1, 'telephone': '13500010006', 'username': 'wintest2'}, {'address': '上海市黄浦区', 'id': 3, 'password': '0228dbb995f3d37a7ea901269d5fa61a', 'role': 1, 'sex': 1, 'telephone': '13500010007', 'username': 'wintest3'}, {'address': '成都市武侯区', 'id': 4, 'password': 'a4d4c12db14629f9711442ddb0d03c57', 'role': 1, 'sex': 0, 'telephone': '13500010004', 'username': 'gq'}, {'address': '深圳市宝安区', 'id': 6, 'password': 'ef0875fbf6504207d1c6d2d6c11ca2c0', 'role': 1, 'sex': 1, 'telephone': '13599999999', 'username': 'wintest4'}], 'msg': '查询成功'}
[2022-09-05 11:18:36,979][read_data.py 40][INFO]: 加载 C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\config\setting.ini 文件......
[2022-09-05 11:18:37,125][read_data.py 40][INFO]: 加载 C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\config\setting.ini 文件......
[2022-09-05 11:18:37,347][read_data.py 26][INFO]: 加载 C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\data\api_test_data.yml 文件......
[2022-09-05 11:18:37,362][read_data.py 29][INFO]: 读到数据 ==>> {'test_get_all_user_info': [[True, 0, '查询成功']]}
[2022-09-05 11:18:37,670][test_01_get_user_info.py 15][INFO]: ********** 开始执行用例 **********
[2022-09-05 11:18:37,671][rest_client.py 55][INFO]: 接口请求地址 ==>> http://119.3.55.6:9999/users
[2022-09-05 11:18:37,674][rest_client.py 56][INFO]: 接口请求方式 ==>> GET
[2022-09-05 11:18:37,676][rest_client.py 58][INFO]: 接口请求头 ==>> null
[2022-09-05 11:18:37,677][rest_client.py 59][INFO]: 接口请求 params 参数 ==>> null
[2022-09-05 11:18:37,677][rest_client.py 60][INFO]: 接口请求体 data 参数 ==>> null
[2022-09-05 11:18:37,678][rest_client.py 61][INFO]: 接口请求体 json 参数 ==>> null
[2022-09-05 11:18:37,681][rest_client.py 62][INFO]: 接口上传附件 files 参数 ==>> None
[2022-09-05 11:18:37,681][rest_client.py 63][INFO]: 接口 cookies 参数 ==>> null

View File

@ -0,0 +1 @@
{"uuid": "df3c34e1-d038-4dc1-919e-09855240428e", "befores": [{"name": "except_code", "status": "passed", "start": 1662297697135, "stop": 1662297697135}], "start": 1662297697135, "stop": 1662297697284}

View File

@ -0,0 +1 @@
{"uuid": "df6cc4cd-0d27-4464-a8e4-de2d1077c4c8", "befores": [{"name": "except_result", "status": "passed", "start": 1662297697135, "stop": 1662297697135}], "start": 1662297697135, "stop": 1662297697284}

View File

@ -0,0 +1 @@
{"name": "test_get_all_user_info[True-0-查询成功]", "status": "passed", "attachments": [{"name": "log", "source": "9250b8f6-602c-411e-9037-bd737b35f1c1-attachment.txt", "type": "text/plain"}], "parameters": [{"name": "except_result", "value": "True"}, {"name": "except_code", "value": "0"}, {"name": "except_msg", "value": "'查询成功'"}], "start": 1662297697155, "stop": 1662297697284, "uuid": "36816fc1-4d12-4f7a-8ab2-36a3aaf1839b", "historyId": "8fa120af048dc3f86b08ef0469022873", "testCaseId": "c8c195e0d2fed438fa6bca8fa8984833", "fullName": "testcases.api_test.test_01_get_user_info.TestGetUserInfo#test_get_all_user_info", "labels": [{"name": "parentSuite", "value": "testcases.api_test"}, {"name": "suite", "value": "test_01_get_user_info"}, {"name": "subSuite", "value": "TestGetUserInfo"}, {"name": "host", "value": "DESKTOP-SI77TGN"}, {"name": "thread", "value": "12600-MainThread"}, {"name": "framework", "value": "pytest"}, {"name": "language", "value": "cpython3"}, {"name": "package", "value": "testcases.api_test.test_01_get_user_info"}]}

View File

@ -0,0 +1,2 @@
INFO  log:test_01_get_user_info.py:15 ********** 开始执行用例 **********
INFO  log:rest_client.py:55 接口请求地址 ==>> http://119.3.55.6:9999/users

View File

@ -0,0 +1 @@
{"uuid": "00a434ae-b4e3-4c4b-9d20-471fba77c66e", "befores": [{"name": "except_msg", "status": "passed", "start": 1662297697135, "stop": 1662297697135}], "start": 1662297697135, "stop": 1662297697284}

View File

@ -0,0 +1 @@
{"uuid": "f47476ac-a079-4587-a7c9-c275b535292f", "befores": [{"name": "except_result", "status": "passed", "start": 1662347917660, "stop": 1662347917662}], "start": 1662347917660, "stop": 1662347917837}

View File

@ -0,0 +1,2 @@
INFO log:test_01_get_user_info.py:15 ********** 开始执行用例 **********
INFO log:rest_client.py:55 接口请求地址 ==>> http://119.3.55.6:9999/users

View File

@ -0,0 +1 @@
{"uuid": "0ec80ee2-189b-4cd6-87e6-f11af6f29811", "befores": [{"name": "except_code", "status": "passed", "start": 1662344098062, "stop": 1662344098062}], "start": 1662344098062, "stop": 1662344098163}

View File

@ -0,0 +1 @@
{"uuid": "6fda8268-7b1a-4cf6-80d5-24d8b68e8cfa", "befores": [{"name": "except_result", "status": "passed", "start": 1662344237950, "stop": 1662344237950}], "start": 1662344237950, "stop": 1662344238360}

View File

@ -0,0 +1 @@
{"uuid": "e02fffc8-1fe8-4245-b424-c178e755edd0", "befores": [{"name": "except_result", "status": "passed", "start": 1662344404152, "stop": 1662344404152}], "start": 1662344404152, "stop": 1662344404248}

View File

@ -0,0 +1,154 @@
[2022-09-05 10:19:43,690][test_01_get_user_info.py 15][INFO]: ********** 开始执行用例 **********
[2022-09-05 10:19:43,691][rest_client.py 55][INFO]: 接口请求地址 ==>> http://119.3.55.6:9999/users
--- Logging error ---
Traceback (most recent call last):
File "D:\Python39\lib\logging\__init__.py", line 1083, in emit
msg = self.format(record)
File "D:\Python39\lib\logging\__init__.py", line 927, in format
return fmt.format(record)
File "D:\Python39\lib\logging\__init__.py", line 663, in format
record.message = record.getMessage()
File "D:\Python39\lib\logging\__init__.py", line 367, in getMessage
msg = msg % self.args
TypeError: not all arguments converted during string formatting
Call stack:
File "D:\Program Files\PyCharm\pycharm-professional\PyCharm 2021.3.1\plugins\python\helpers\pycharm\_jb_pytest_runner.py", line 51, in <module>
sys.exit(pytest.main(args, plugins_to_load + [Plugin]))
File "C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\venv\lib\site-packages\_pytest\config\__init__.py", line 164, in main
ret: Union[ExitCode, int] = config.hook.pytest_cmdline_main(
File "C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\venv\lib\site-packages\pluggy\_hooks.py", line 265, in __call__
return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
File "C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\venv\lib\site-packages\pluggy\_manager.py", line 80, in _hookexec
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
File "C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\venv\lib\site-packages\pluggy\_callers.py", line 39, in _multicall
res = hook_impl.function(*args)
File "C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\venv\lib\site-packages\_pytest\main.py", line 315, in pytest_cmdline_main
return wrap_session(config, _main)
File "C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\venv\lib\site-packages\_pytest\main.py", line 268, in wrap_session
session.exitstatus = doit(config, session) or 0
File "C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\venv\lib\site-packages\_pytest\main.py", line 322, in _main
config.hook.pytest_runtestloop(session=session)
File "C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\venv\lib\site-packages\pluggy\_hooks.py", line 265, in __call__
return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
File "C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\venv\lib\site-packages\pluggy\_manager.py", line 80, in _hookexec
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
File "C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\venv\lib\site-packages\pluggy\_callers.py", line 39, in _multicall
res = hook_impl.function(*args)
File "C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\venv\lib\site-packages\_pytest\main.py", line 347, in pytest_runtestloop
item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem)
File "C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\venv\lib\site-packages\pluggy\_hooks.py", line 265, in __call__
return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
File "C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\venv\lib\site-packages\pluggy\_manager.py", line 80, in _hookexec
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
File "C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\venv\lib\site-packages\pluggy\_callers.py", line 39, in _multicall
res = hook_impl.function(*args)
File "C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\venv\lib\site-packages\_pytest\runner.py", line 111, in pytest_runtest_protocol
runtestprotocol(item, nextitem=nextitem)
File "C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\venv\lib\site-packages\_pytest\runner.py", line 130, in runtestprotocol
reports.append(call_and_report(item, "call", log))
File "C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\venv\lib\site-packages\_pytest\runner.py", line 219, in call_and_report
call = call_runtest_hook(item, when, **kwds)
File "C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\venv\lib\site-packages\_pytest\runner.py", line 258, in call_runtest_hook
return CallInfo.from_call(
File "C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\venv\lib\site-packages\_pytest\runner.py", line 338, in from_call
result: Optional[TResult] = func()
File "C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\venv\lib\site-packages\_pytest\runner.py", line 259, in <lambda>
lambda: ihook(item=item, **kwds), when=when, reraise=reraise
File "C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\venv\lib\site-packages\pluggy\_hooks.py", line 265, in __call__
return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
File "C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\venv\lib\site-packages\pluggy\_manager.py", line 80, in _hookexec
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
File "C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\venv\lib\site-packages\pluggy\_callers.py", line 39, in _multicall
res = hook_impl.function(*args)
File "C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\venv\lib\site-packages\_pytest\runner.py", line 166, in pytest_runtest_call
item.runtest()
File "C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\venv\lib\site-packages\_pytest\python.py", line 1761, in runtest
self.ihook.pytest_pyfunc_call(pyfuncitem=self)
File "C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\venv\lib\site-packages\pluggy\_hooks.py", line 265, in __call__
return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
File "C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\venv\lib\site-packages\pluggy\_manager.py", line 80, in _hookexec
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
File "C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\venv\lib\site-packages\pluggy\_callers.py", line 39, in _multicall
res = hook_impl.function(*args)
File "C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\venv\lib\site-packages\_pytest\python.py", line 192, in pytest_pyfunc_call
result = testfunction(**testargs)
File "C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\testcases\api_test\test_01_get_user_info.py", line 18, in test_get_all_user_info
logger.info("接口返回 ==>> ", str(result.response.json()))
Message: '接口返回 ==>> '
Arguments: ("{'code': 0, 'data': [{'address': '上海市黄浦区', 'id': 1, 'password': '8fcde9debf630eeee3162b2b70d31082', 'role': 1, 'sex': 1, 'telephone': '13500010005', 'username': 'wintest1'}, {'address': '上海市黄浦区', 'id': 2, 'password': '699423835a085ed49cfc27cb93965149', 'role': 1, 'sex': 1, 'telephone': '13500010006', 'username': 'wintest2'}, {'address': '上海市黄浦区', 'id': 3, 'password': '0228dbb995f3d37a7ea901269d5fa61a', 'role': 1, 'sex': 1, 'telephone': '13500010007', 'username': 'wintest3'}, {'address': '成都市武侯区', 'id': 4, 'password': 'a4d4c12db14629f9711442ddb0d03c57', 'role': 1, 'sex': 0, 'telephone': '13500010004', 'username': 'gq'}, {'address': '深圳市宝安区', 'id': 6, 'password': 'ef0875fbf6504207d1c6d2d6c11ca2c0', 'role': 1, 'sex': 1, 'telephone': '13599999999', 'username': 'wintest4'}], 'msg': '查询成功'}",)
--- Logging error ---
Traceback (most recent call last):
File "D:\Python39\lib\logging\__init__.py", line 1083, in emit
msg = self.format(record)
File "D:\Python39\lib\logging\__init__.py", line 927, in format
return fmt.format(record)
File "D:\Python39\lib\logging\__init__.py", line 663, in format
record.message = record.getMessage()
File "D:\Python39\lib\logging\__init__.py", line 367, in getMessage
msg = msg % self.args
TypeError: not all arguments converted during string formatting
Call stack:
File "D:\Program Files\PyCharm\pycharm-professional\PyCharm 2021.3.1\plugins\python\helpers\pycharm\_jb_pytest_runner.py", line 51, in <module>
sys.exit(pytest.main(args, plugins_to_load + [Plugin]))
File "C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\venv\lib\site-packages\_pytest\config\__init__.py", line 164, in main
ret: Union[ExitCode, int] = config.hook.pytest_cmdline_main(
File "C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\venv\lib\site-packages\pluggy\_hooks.py", line 265, in __call__
return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
File "C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\venv\lib\site-packages\pluggy\_manager.py", line 80, in _hookexec
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
File "C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\venv\lib\site-packages\pluggy\_callers.py", line 39, in _multicall
res = hook_impl.function(*args)
File "C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\venv\lib\site-packages\_pytest\main.py", line 315, in pytest_cmdline_main
return wrap_session(config, _main)
File "C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\venv\lib\site-packages\_pytest\main.py", line 268, in wrap_session
session.exitstatus = doit(config, session) or 0
File "C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\venv\lib\site-packages\_pytest\main.py", line 322, in _main
config.hook.pytest_runtestloop(session=session)
File "C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\venv\lib\site-packages\pluggy\_hooks.py", line 265, in __call__
return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
File "C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\venv\lib\site-packages\pluggy\_manager.py", line 80, in _hookexec
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
File "C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\venv\lib\site-packages\pluggy\_callers.py", line 39, in _multicall
res = hook_impl.function(*args)
File "C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\venv\lib\site-packages\_pytest\main.py", line 347, in pytest_runtestloop
item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem)
File "C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\venv\lib\site-packages\pluggy\_hooks.py", line 265, in __call__
return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
File "C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\venv\lib\site-packages\pluggy\_manager.py", line 80, in _hookexec
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
File "C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\venv\lib\site-packages\pluggy\_callers.py", line 39, in _multicall
res = hook_impl.function(*args)
File "C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\venv\lib\site-packages\_pytest\runner.py", line 111, in pytest_runtest_protocol
runtestprotocol(item, nextitem=nextitem)
File "C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\venv\lib\site-packages\_pytest\runner.py", line 130, in runtestprotocol
reports.append(call_and_report(item, "call", log))
File "C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\venv\lib\site-packages\_pytest\runner.py", line 219, in call_and_report
call = call_runtest_hook(item, when, **kwds)
File "C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\venv\lib\site-packages\_pytest\runner.py", line 258, in call_runtest_hook
return CallInfo.from_call(
File "C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\venv\lib\site-packages\_pytest\runner.py", line 338, in from_call
result: Optional[TResult] = func()
File "C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\venv\lib\site-packages\_pytest\runner.py", line 259, in <lambda>
lambda: ihook(item=item, **kwds), when=when, reraise=reraise
File "C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\venv\lib\site-packages\pluggy\_hooks.py", line 265, in __call__
return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
File "C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\venv\lib\site-packages\pluggy\_manager.py", line 80, in _hookexec
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
File "C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\venv\lib\site-packages\pluggy\_callers.py", line 39, in _multicall
res = hook_impl.function(*args)
File "C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\venv\lib\site-packages\_pytest\runner.py", line 166, in pytest_runtest_call
item.runtest()
File "C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\venv\lib\site-packages\_pytest\python.py", line 1761, in runtest
self.ihook.pytest_pyfunc_call(pyfuncitem=self)
File "C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\venv\lib\site-packages\pluggy\_hooks.py", line 265, in __call__
return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
File "C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\venv\lib\site-packages\pluggy\_manager.py", line 80, in _hookexec
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
File "C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\venv\lib\site-packages\pluggy\_callers.py", line 39, in _multicall
res = hook_impl.function(*args)
File "C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\venv\lib\site-packages\_pytest\python.py", line 192, in pytest_pyfunc_call
result = testfunction(**testargs)
File "C:\Users\gaoqiang\PycharmProjects\xthk_Auto_Test\testcases\api_test\test_01_get_user_info.py", line 18, in test_get_all_user_info
logger.info("接口返回 ==>> ", str(result.response.json()))
Message: '接口返回 ==>> '
Arguments: ("{'code': 0, 'data': [{'address': '上海市黄浦区', 'id': 1, 'password': '8fcde9debf630eeee3162b2b70d31082', 'role': 1, 'sex': 1, 'telephone': '13500010005', 'username': 'wintest1'}, {'address': '上海市黄浦区', 'id': 2, 'password': '699423835a085ed49cfc27cb93965149', 'role': 1, 'sex': 1, 'telephone': '13500010006', 'username': 'wintest2'}, {'address': '上海市黄浦区', 'id': 3, 'password': '0228dbb995f3d37a7ea901269d5fa61a', 'role': 1, 'sex': 1, 'telephone': '13500010007', 'username': 'wintest3'}, {'address': '成都市武侯区', 'id': 4, 'password': 'a4d4c12db14629f9711442ddb0d03c57', 'role': 1, 'sex': 0, 'telephone': '13500010004', 'username': 'gq'}, {'address': '深圳市宝安区', 'id': 6, 'password': 'ef0875fbf6504207d1c6d2d6c11ca2c0', 'role': 1, 'sex': 1, 'telephone': '13599999999', 'username': 'wintest4'}], 'msg': '查询成功'}",)

View File

@ -0,0 +1 @@
{"name": "test_get_all_user_info[True-0-查询成功]", "status": "broken", "statusDetails": {"message": "TypeError: can only concatenate str (not \"dict\") to str", "trace": "self = <testcases.api_test.test_01_get_user_info.TestGetUserInfo object at 0x0000019C2244D160>\nexcept_result = True, except_code = 0, except_msg = '查询成功'\n\n @pytest.mark.parametrize(\"except_result, except_code, except_msg\",\n api_data[\"test_get_all_user_info\"])\n def test_get_all_user_info(self, except_result, except_code, except_msg):\n logger.info(\"********** 开始执行用例 **********\")\n result = get_all_user_info()\n print(result.response.json())\n> logger.info(\"接口返回 ==>> \"+result.response.json())\nE TypeError: can only concatenate str (not \"dict\") to str\n\ntest_01_get_user_info.py:18: TypeError"}, "attachments": [{"name": "log", "source": "be5202c7-82c1-4fea-a966-9b568b5008eb-attachment.txt", "type": "text/plain"}, {"name": "stdout", "source": "34f3b5b3-08e3-4196-8fd1-27d39f9f7a8d-attachment.txt", "type": "text/plain"}, {"name": "stderr", "source": "a04dd7c6-a173-400f-8194-c948e76f14fe-attachment.txt", "type": "text/plain"}], "parameters": [{"name": "except_result", "value": "True"}, {"name": "except_code", "value": "0"}, {"name": "except_msg", "value": "'查询成功'"}], "start": 1662344237951, "stop": 1662344238051, "uuid": "992d52b0-98e8-4680-95c8-629181846406", "historyId": "8fa120af048dc3f86b08ef0469022873", "testCaseId": "c8c195e0d2fed438fa6bca8fa8984833", "fullName": "testcases.api_test.test_01_get_user_info.TestGetUserInfo#test_get_all_user_info", "labels": [{"name": "parentSuite", "value": "testcases.api_test"}, {"name": "suite", "value": "test_01_get_user_info"}, {"name": "subSuite", "value": "TestGetUserInfo"}, {"name": "host", "value": "DESKTOP-SI77TGN"}, {"name": "thread", "value": "13612-MainThread"}, {"name": "framework", "value": "pytest"}, {"name": "language", "value": "cpython3"}, {"name": "package", "value": "testcases.api_test.test_01_get_user_info"}]}

View File

@ -0,0 +1,3 @@
[2022-09-05 10:16:43,575][test_01_get_user_info.py 15][INFO]: ********** 开始执行用例 **********
[2022-09-05 10:16:43,575][rest_client.py 55][INFO]: 接口请求地址 ==>> http://119.3.55.6:9999/users
[2022-09-05 10:16:43,670][test_01_get_user_info.py 18][INFO]: 接口返回 ==>>

View File

@ -0,0 +1 @@
{"uuid": "56d09677-273e-416d-bc04-0614b4054397", "befores": [{"name": "except_msg", "status": "passed", "start": 1662347917662, "stop": 1662347917662}], "start": 1662347917662, "stop": 1662347917819}

View File

@ -0,0 +1 @@
{"uuid": "9545ed93-2c26-4eab-92f2-53bfb645df6b", "befores": [{"name": "except_msg", "status": "passed", "start": 1662344237950, "stop": 1662344237950}], "start": 1662344237950, "stop": 1662344238357}

View File

@ -0,0 +1 @@
{'code': 0, 'data': [{'address': '上海市黄浦区', 'id': 1, 'password': '8fcde9debf630eeee3162b2b70d31082', 'role': 1, 'sex': 1, 'telephone': '13500010005', 'username': 'wintest1'}, {'address': '上海市黄浦区', 'id': 2, 'password': '699423835a085ed49cfc27cb93965149', 'role': 1, 'sex': 1, 'telephone': '13500010006', 'username': 'wintest2'}, {'address': '上海市黄浦区', 'id': 3, 'password': '0228dbb995f3d37a7ea901269d5fa61a', 'role': 1, 'sex': 1, 'telephone': '13500010007', 'username': 'wintest3'}, {'address': '成都市武侯区', 'id': 4, 'password': 'a4d4c12db14629f9711442ddb0d03c57', 'role': 1, 'sex': 0, 'telephone': '13500010004', 'username': 'gq'}, {'address': '深圳市宝安区', 'id': 6, 'password': 'ef0875fbf6504207d1c6d2d6c11ca2c0', 'role': 1, 'sex': 1, 'telephone': '13599999999', 'username': 'wintest4'}], 'msg': '查询成功'}

View File

@ -0,0 +1 @@
{"uuid": "227837f4-a6b0-4b3c-b231-925494f61386", "befores": [{"name": "except_code", "status": "passed", "start": 1662344060998, "stop": 1662344060998}], "start": 1662344060998, "stop": 1662344061211}

View File

@ -0,0 +1,9 @@
[2022-09-05 11:18:37,670][test_01_get_user_info.py 15][INFO]: ********** 开始执行用例 **********
[2022-09-05 11:18:37,671][rest_client.py 55][INFO]: 接口请求地址 ==>> http://119.3.55.6:9999/users
[2022-09-05 11:18:37,674][rest_client.py 56][INFO]: 接口请求方式 ==>> GET
[2022-09-05 11:18:37,676][rest_client.py 58][INFO]: 接口请求头 ==>> null
[2022-09-05 11:18:37,677][rest_client.py 59][INFO]: 接口请求 params 参数 ==>> null
[2022-09-05 11:18:37,677][rest_client.py 60][INFO]: 接口请求体 data 参数 ==>> null
[2022-09-05 11:18:37,678][rest_client.py 61][INFO]: 接口请求体 json 参数 ==>> null
[2022-09-05 11:18:37,681][rest_client.py 62][INFO]: 接口上传附件 files 参数 ==>> None
[2022-09-05 11:18:37,681][rest_client.py 63][INFO]: 接口 cookies 参数 ==>> null

View File

@ -0,0 +1 @@
{"name": "test_get_all_user_info[True-0-查询成功]", "status": "passed", "attachments": [{"name": "log", "source": "75967a09-90de-41cf-a6c8-e96c8b2496aa-attachment.txt", "type": "text/plain"}, {"name": "stderr", "source": "37b84d3e-8572-44b9-879d-fd34dad09f35-attachment.txt", "type": "text/plain"}], "parameters": [{"name": "except_result", "value": "True"}, {"name": "except_code", "value": "0"}, {"name": "except_msg", "value": "'查询成功'"}], "start": 1662347917669, "stop": 1662347917802, "uuid": "a4f5179f-1779-44ec-81e9-bc056b2eab98", "historyId": "8fa120af048dc3f86b08ef0469022873", "testCaseId": "c8c195e0d2fed438fa6bca8fa8984833", "fullName": "testcases.api_test.test_01_get_user_info.TestGetUserInfo#test_get_all_user_info", "labels": [{"name": "parentSuite", "value": "testcases.api_test"}, {"name": "suite", "value": "test_01_get_user_info"}, {"name": "subSuite", "value": "TestGetUserInfo"}, {"name": "host", "value": "DESKTOP-SI77TGN"}, {"name": "thread", "value": "7352-MainThread"}, {"name": "framework", "value": "pytest"}, {"name": "language", "value": "cpython3"}, {"name": "package", "value": "testcases.api_test.test_01_get_user_info"}]}

View File

@ -0,0 +1 @@
{"uuid": "3f6676c7-0a21-4073-b8ad-7164414d121e", "befores": [{"name": "except_msg", "status": "passed", "start": 1662344383680, "stop": 1662344383680}], "start": 1662344383680, "stop": 1662344384483}

View File

@ -0,0 +1 @@
{"uuid": "278d13c8-680f-4f77-8954-4073b844e2b3", "befores": [{"name": "except_code", "status": "passed", "start": 1662347917662, "stop": 1662347917662}], "start": 1662347917662, "stop": 1662347917836}

View File

@ -0,0 +1 @@
{"uuid": "256027ab-c16c-4acd-b64f-98e6faee7f44", "befores": [{"name": "except_result", "status": "passed", "start": 1662344115393, "stop": 1662344115393}], "start": 1662344115393, "stop": 1662344115506}

View File

@ -0,0 +1 @@
{"name": "test_get_all_user_info[True-0-查询成功]", "status": "passed", "attachments": [{"name": "log", "source": "8bed5a64-acf3-4954-bd2d-ff92118a7871-attachment.txt", "type": "text/plain"}, {"name": "stdout", "source": "df19acdc-730c-41ea-92f8-db7fa77fca94-attachment.txt", "type": "text/plain"}, {"name": "stderr", "source": "fb223c7d-5f5e-4907-9987-9649297d839c-attachment.txt", "type": "text/plain"}], "parameters": [{"name": "except_result", "value": "True"}, {"name": "except_code", "value": "0"}, {"name": "except_msg", "value": "'查询成功'"}], "start": 1662344061020, "stop": 1662344061182, "uuid": "d82bbd10-f023-4189-bbc1-bdcff1298cd6", "historyId": "8fa120af048dc3f86b08ef0469022873", "testCaseId": "c8c195e0d2fed438fa6bca8fa8984833", "fullName": "testcases.api_test.test_01_get_user_info.TestGetUserInfo#test_get_all_user_info", "labels": [{"name": "parentSuite", "value": "testcases.api_test"}, {"name": "suite", "value": "test_01_get_user_info"}, {"name": "subSuite", "value": "TestGetUserInfo"}, {"name": "host", "value": "DESKTOP-SI77TGN"}, {"name": "thread", "value": "5736-MainThread"}, {"name": "framework", "value": "pytest"}, {"name": "language", "value": "cpython3"}, {"name": "package", "value": "testcases.api_test.test_01_get_user_info"}]}

View File

@ -0,0 +1 @@
{"uuid": "d11ac813-72fe-4e2c-be5f-aab8201226a5", "befores": [{"name": "except_msg", "status": "passed", "start": 1662344115393, "stop": 1662344115393}], "start": 1662344115393, "stop": 1662344115501}

View File

@ -0,0 +1,2 @@
INFO log:test_01_get_user_info.py:15 ********** 开始执行用例 **********
INFO log:rest_client.py:55 接口请求地址 ==>> http://119.3.55.6:9999/users

View File

@ -0,0 +1,3 @@
INFO log:test_01_get_user_info.py:15 ********** 开始执行用例 **********
INFO log:rest_client.py:55 接口请求地址 ==>> http://119.3.55.6:9999/users
INFO log:test_01_get_user_info.py:18 接口返回 ==>>

View File

@ -0,0 +1 @@
{"uuid": "5318b72f-3478-46d8-bc1f-aa1b7ee7651f", "befores": [{"name": "except_code", "status": "passed", "start": 1662344237950, "stop": 1662344237950}], "start": 1662344237950, "stop": 1662344238358}

View File

@ -0,0 +1 @@
{'code': 0, 'data': [{'address': '上海市黄浦区', 'id': 1, 'password': '8fcde9debf630eeee3162b2b70d31082', 'role': 1, 'sex': 1, 'telephone': '13500010005', 'username': 'wintest1'}, {'address': '上海市黄浦区', 'id': 2, 'password': '699423835a085ed49cfc27cb93965149', 'role': 1, 'sex': 1, 'telephone': '13500010006', 'username': 'wintest2'}, {'address': '上海市黄浦区', 'id': 3, 'password': '0228dbb995f3d37a7ea901269d5fa61a', 'role': 1, 'sex': 1, 'telephone': '13500010007', 'username': 'wintest3'}, {'address': '成都市武侯区', 'id': 4, 'password': 'a4d4c12db14629f9711442ddb0d03c57', 'role': 1, 'sex': 0, 'telephone': '13500010004', 'username': 'gq'}, {'address': '深圳市宝安区', 'id': 6, 'password': 'ef0875fbf6504207d1c6d2d6c11ca2c0', 'role': 1, 'sex': 1, 'telephone': '13599999999', 'username': 'wintest4'}], 'msg': '查询成功'}

View File

@ -0,0 +1 @@
{"uuid": "57633e08-576b-451e-a861-65e391429084", "befores": [{"name": "except_result", "status": "passed", "start": 1662344383679, "stop": 1662344383679}], "start": 1662344383679, "stop": 1662344384487}

View File

@ -0,0 +1 @@
{'code': 0, 'data': [{'address': '上海市黄浦区', 'id': 1, 'password': '8fcde9debf630eeee3162b2b70d31082', 'role': 1, 'sex': 1, 'telephone': '13500010005', 'username': 'wintest1'}, {'address': '上海市黄浦区', 'id': 2, 'password': '699423835a085ed49cfc27cb93965149', 'role': 1, 'sex': 1, 'telephone': '13500010006', 'username': 'wintest2'}, {'address': '上海市黄浦区', 'id': 3, 'password': '0228dbb995f3d37a7ea901269d5fa61a', 'role': 1, 'sex': 1, 'telephone': '13500010007', 'username': 'wintest3'}, {'address': '成都市武侯区', 'id': 4, 'password': 'a4d4c12db14629f9711442ddb0d03c57', 'role': 1, 'sex': 0, 'telephone': '13500010004', 'username': 'gq'}, {'address': '深圳市宝安区', 'id': 6, 'password': 'ef0875fbf6504207d1c6d2d6c11ca2c0', 'role': 1, 'sex': 1, 'telephone': '13599999999', 'username': 'wintest4'}], 'msg': '查询成功'}

View File

@ -0,0 +1 @@
{"uuid": "2859b4a4-aa7e-4011-a11f-48e6300ed4ef", "befores": [{"name": "except_code", "status": "passed", "start": 1662344115393, "stop": 1662344115393}], "start": 1662344115393, "stop": 1662344115503}

View File

@ -0,0 +1,9 @@
INFO log:test_01_get_user_info.py:15 ********** 开始执行用例 **********
INFO log:rest_client.py:55 接口请求地址 ==>> http://119.3.55.6:9999/users
INFO log:rest_client.py:56 接口请求方式 ==>> GET
INFO log:rest_client.py:58 接口请求头 ==>> null
INFO log:rest_client.py:59 接口请求 params 参数 ==>> null
INFO log:rest_client.py:60 接口请求体 data 参数 ==>> null
INFO log:rest_client.py:61 接口请求体 json 参数 ==>> null
INFO log:rest_client.py:62 接口上传附件 files 参数 ==>> None
INFO log:rest_client.py:63 接口 cookies 参数 ==>> null

View File

@ -0,0 +1 @@
{"uuid": "fb83e451-34c9-41a8-91ab-b9242ef97a1e", "befores": [{"name": "except_result", "status": "passed", "start": 1662344203575, "stop": 1662344203575}], "start": 1662344203575, "stop": 1662344203686}

View File

@ -0,0 +1 @@
{"uuid": "5ab87307-f5f2-4abc-a14f-43c10bcb98d7", "befores": [{"name": "except_result", "status": "passed", "start": 1662344060996, "stop": 1662344060996}], "start": 1662344060996, "stop": 1662344061212}

View File

@ -0,0 +1,2 @@
INFO log:test_01_get_user_info.py:15 ********** 开始执行用例 **********
INFO log:rest_client.py:55 接口请求地址 ==>> http://119.3.55.6:9999/users

View File

@ -0,0 +1 @@
{"name": "test_get_all_user_info[True-0-查询成功]", "status": "broken", "statusDetails": {"message": "TypeError: not all arguments converted during string formatting", "trace": "self = <testcases.api_test.test_01_get_user_info.TestGetUserInfo object at 0x000001FC2C950D60>\nexcept_result = True, except_code = 0, except_msg = '查询成功'\n\n @pytest.mark.parametrize(\"except_result, except_code, except_msg\",\n api_data[\"test_get_all_user_info\"])\n def test_get_all_user_info(self, except_result, except_code, except_msg):\n logger.info(\"********** 开始执行用例 **********\")\n result = get_all_user_info()\n print(result.response.json())\n> logger.info(\"接口返回 ==>> \", str(result.response.json()))\n\ntest_01_get_user_info.py:18: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\nD:\\Python39\\lib\\logging\\__init__.py:1446: in info\n self._log(INFO, msg, args, **kwargs)\nD:\\Python39\\lib\\logging\\__init__.py:1589: in _log\n self.handle(record)\nD:\\Python39\\lib\\logging\\__init__.py:1599: in handle\n self.callHandlers(record)\nD:\\Python39\\lib\\logging\\__init__.py:1661: in callHandlers\n hdlr.handle(record)\nD:\\Python39\\lib\\logging\\__init__.py:952: in handle\n self.emit(record)\n..\\..\\venv\\lib\\site-packages\\_pytest\\logging.py:342: in emit\n super().emit(record)\nD:\\Python39\\lib\\logging\\__init__.py:1091: in emit\n self.handleError(record)\nD:\\Python39\\lib\\logging\\__init__.py:1083: in emit\n msg = self.format(record)\nD:\\Python39\\lib\\logging\\__init__.py:927: in format\n return fmt.format(record)\n..\\..\\venv\\lib\\site-packages\\_pytest\\logging.py:113: in format\n return super().format(record)\nD:\\Python39\\lib\\logging\\__init__.py:663: in format\n record.message = record.getMessage()\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\n\nself = <LogRecord: log, 20, C:\\Users\\gaoqiang\\PycharmProjects\\xthk_Auto_Test\\testcases\\api_test\\test_01_get_user_info.py, 18, \"接口返回 ==>> \">\n\n def getMessage(self):\n \"\"\"\n Return the message for this LogRecord.\n \n Return the message for this LogRecord after merging any user-supplied\n arguments with the message.\n \"\"\"\n msg = str(self.msg)\n if self.args:\n> msg = msg % self.args\nE TypeError: not all arguments converted during string formatting\n\nD:\\Python39\\lib\\logging\\__init__.py:367: TypeError"}, "attachments": [{"name": "log", "source": "11a28fef-7d75-4570-9730-0fcf72895e54-attachment.txt", "type": "text/plain"}, {"name": "stdout", "source": "afb20bc4-deb1-4e9e-886b-ce256cd4ae34-attachment.txt", "type": "text/plain"}, {"name": "stderr", "source": "28ec83bf-683f-4f87-9eb4-ed72108f6c92-attachment.txt", "type": "text/plain"}], "parameters": [{"name": "except_result", "value": "True"}, {"name": "except_code", "value": "0"}, {"name": "except_msg", "value": "'查询成功'"}], "start": 1662344383690, "stop": 1662344383857, "uuid": "830a6551-304c-4c99-a81b-7514edfc32d2", "historyId": "8fa120af048dc3f86b08ef0469022873", "testCaseId": "c8c195e0d2fed438fa6bca8fa8984833", "fullName": "testcases.api_test.test_01_get_user_info.TestGetUserInfo#test_get_all_user_info", "labels": [{"name": "parentSuite", "value": "testcases.api_test"}, {"name": "suite", "value": "test_01_get_user_info"}, {"name": "subSuite", "value": "TestGetUserInfo"}, {"name": "host", "value": "DESKTOP-SI77TGN"}, {"name": "thread", "value": "8624-MainThread"}, {"name": "framework", "value": "pytest"}, {"name": "language", "value": "cpython3"}, {"name": "package", "value": "testcases.api_test.test_01_get_user_info"}]}

View File

@ -0,0 +1 @@
{'code': 0, 'data': [{'address': '上海市黄浦区', 'id': 1, 'password': '8fcde9debf630eeee3162b2b70d31082', 'role': 1, 'sex': 1, 'telephone': '13500010005', 'username': 'wintest1'}, {'address': '上海市黄浦区', 'id': 2, 'password': '699423835a085ed49cfc27cb93965149', 'role': 1, 'sex': 1, 'telephone': '13500010006', 'username': 'wintest2'}, {'address': '上海市黄浦区', 'id': 3, 'password': '0228dbb995f3d37a7ea901269d5fa61a', 'role': 1, 'sex': 1, 'telephone': '13500010007', 'username': 'wintest3'}, {'address': '成都市武侯区', 'id': 4, 'password': 'a4d4c12db14629f9711442ddb0d03c57', 'role': 1, 'sex': 0, 'telephone': '13500010004', 'username': 'gq'}, {'address': '深圳市宝安区', 'id': 6, 'password': 'ef0875fbf6504207d1c6d2d6c11ca2c0', 'role': 1, 'sex': 1, 'telephone': '13599999999', 'username': 'wintest4'}], 'msg': '查询成功'}

View File

@ -0,0 +1,2 @@
[2022-09-05 10:17:17,950][test_01_get_user_info.py 15][INFO]: ********** 开始执行用例 **********
[2022-09-05 10:17:17,951][rest_client.py 55][INFO]: 接口请求地址 ==>> http://119.3.55.6:9999/users

View File

@ -0,0 +1 @@
{"uuid": "74107311-2b5c-407e-8eb0-9fe1842ad12a", "befores": [{"name": "except_msg", "status": "passed", "start": 1662344404152, "stop": 1662344404152}], "start": 1662344404152, "stop": 1662344404243}

View File

@ -0,0 +1 @@
{"name": "test_get_all_user_info[True-0-查询成功]", "status": "passed", "attachments": [{"name": "log", "source": "48fecfce-8be2-4ca5-92fa-fd42f2399d5d-attachment.txt", "type": "text/plain"}, {"name": "stdout", "source": "69dc98d6-1fc7-4593-a115-56d5d4a75278-attachment.txt", "type": "text/plain"}, {"name": "stderr", "source": "303c1282-5137-4a6f-b1fb-5d8e8f186fe5-attachment.txt", "type": "text/plain"}], "parameters": [{"name": "except_result", "value": "True"}, {"name": "except_code", "value": "0"}, {"name": "except_msg", "value": "'查询成功'"}], "start": 1662344203576, "stop": 1662344203674, "uuid": "9d0cedc5-65a3-41dc-afe4-8c171454bd69", "historyId": "8fa120af048dc3f86b08ef0469022873", "testCaseId": "c8c195e0d2fed438fa6bca8fa8984833", "fullName": "testcases.api_test.test_01_get_user_info.TestGetUserInfo#test_get_all_user_info", "labels": [{"name": "parentSuite", "value": "testcases.api_test"}, {"name": "suite", "value": "test_01_get_user_info"}, {"name": "subSuite", "value": "TestGetUserInfo"}, {"name": "host", "value": "DESKTOP-SI77TGN"}, {"name": "thread", "value": "4924-MainThread"}, {"name": "framework", "value": "pytest"}, {"name": "language", "value": "cpython3"}, {"name": "package", "value": "testcases.api_test.test_01_get_user_info"}]}

View File

@ -0,0 +1 @@
{'code': 0, 'data': [{'address': '上海市黄浦区', 'id': 1, 'password': '8fcde9debf630eeee3162b2b70d31082', 'role': 1, 'sex': 1, 'telephone': '13500010005', 'username': 'wintest1'}, {'address': '上海市黄浦区', 'id': 2, 'password': '699423835a085ed49cfc27cb93965149', 'role': 1, 'sex': 1, 'telephone': '13500010006', 'username': 'wintest2'}, {'address': '上海市黄浦区', 'id': 3, 'password': '0228dbb995f3d37a7ea901269d5fa61a', 'role': 1, 'sex': 1, 'telephone': '13500010007', 'username': 'wintest3'}, {'address': '成都市武侯区', 'id': 4, 'password': 'a4d4c12db14629f9711442ddb0d03c57', 'role': 1, 'sex': 0, 'telephone': '13500010004', 'username': 'gq'}, {'address': '深圳市宝安区', 'id': 6, 'password': 'ef0875fbf6504207d1c6d2d6c11ca2c0', 'role': 1, 'sex': 1, 'telephone': '13599999999', 'username': 'wintest4'}], 'msg': '查询成功'}

View File

@ -0,0 +1 @@
{"uuid": "d0d36e39-099a-4b31-9085-2c3b23554e88", "befores": [{"name": "except_msg", "status": "passed", "start": 1662344060998, "stop": 1662344060998}], "start": 1662344060998, "stop": 1662344061205}

View File

@ -0,0 +1 @@
{"uuid": "6560f45b-b161-4516-8295-9438b747264f", "befores": [{"name": "except_result", "status": "passed", "start": 1662344098062, "stop": 1662344098062}], "start": 1662344098062, "stop": 1662344098166}

View File

@ -0,0 +1 @@
{"uuid": "2c0df5c8-81d2-4394-916d-22d01ff3fbce", "befores": [{"name": "except_msg", "status": "passed", "start": 1662344098062, "stop": 1662344098062}], "start": 1662344098062, "stop": 1662344098155}

View File

@ -0,0 +1 @@
{"name": "test_get_all_user_info[True-0-查询成功]", "status": "passed", "attachments": [{"name": "log", "source": "fb6e459a-b118-4e5c-ab2b-e7906dec2ca9-attachment.txt", "type": "text/plain"}, {"name": "stdout", "source": "983f4441-4df8-471f-9f30-b880f480d786-attachment.txt", "type": "text/plain"}, {"name": "stderr", "source": "ff355f9c-db7d-4a5f-a96a-fe5ed55daa1a-attachment.txt", "type": "text/plain"}], "parameters": [{"name": "except_result", "value": "True"}, {"name": "except_code", "value": "0"}, {"name": "except_msg", "value": "'查询成功'"}], "start": 1662344404153, "stop": 1662344404241, "uuid": "016b48d0-5852-4c02-9e9b-9890baad36b6", "historyId": "8fa120af048dc3f86b08ef0469022873", "testCaseId": "c8c195e0d2fed438fa6bca8fa8984833", "fullName": "testcases.api_test.test_01_get_user_info.TestGetUserInfo#test_get_all_user_info", "labels": [{"name": "parentSuite", "value": "testcases.api_test"}, {"name": "suite", "value": "test_01_get_user_info"}, {"name": "subSuite", "value": "TestGetUserInfo"}, {"name": "host", "value": "DESKTOP-SI77TGN"}, {"name": "thread", "value": "1696-MainThread"}, {"name": "framework", "value": "pytest"}, {"name": "language", "value": "cpython3"}, {"name": "package", "value": "testcases.api_test.test_01_get_user_info"}]}

View File

@ -0,0 +1,2 @@
INFO log:test_01_get_user_info.py:15 ********** 开始执行用例 **********
INFO log:rest_client.py:55 接口请求地址 ==>> http://119.3.55.6:9999/users

View File

@ -0,0 +1,2 @@
INFO log:test_01_get_user_info.py:15 ********** 开始执行用例 **********
INFO log:rest_client.py:55 接口请求地址 ==>> http://119.3.55.6:9999/users

View File

@ -0,0 +1 @@
{"uuid": "1125ac5a-2b20-452d-9bc4-7fbc34ea529c", "befores": [{"name": "except_code", "status": "passed", "start": 1662344404152, "stop": 1662344404152}], "start": 1662344404152, "stop": 1662344404246}

View File

@ -0,0 +1 @@
{"name": "test_get_all_user_info[True-0-查询成功]", "status": "passed", "attachments": [{"name": "log", "source": "b9edd77f-8aa8-4e57-b7ca-926256ceae8f-attachment.txt", "type": "text/plain"}, {"name": "stdout", "source": "5c50f8da-ebcb-498f-9878-a0b72b28241d-attachment.txt", "type": "text/plain"}, {"name": "stderr", "source": "c4a9c1bb-a7e6-43a0-b5fe-42b8be6f7d15-attachment.txt", "type": "text/plain"}], "parameters": [{"name": "except_result", "value": "True"}, {"name": "except_code", "value": "0"}, {"name": "except_msg", "value": "'查询成功'"}], "start": 1662344115394, "stop": 1662344115499, "uuid": "cc811e33-17fe-4ab6-ae42-43c8a98adfa0", "historyId": "8fa120af048dc3f86b08ef0469022873", "testCaseId": "c8c195e0d2fed438fa6bca8fa8984833", "fullName": "testcases.api_test.test_01_get_user_info.TestGetUserInfo#test_get_all_user_info", "labels": [{"name": "parentSuite", "value": "testcases.api_test"}, {"name": "suite", "value": "test_01_get_user_info"}, {"name": "subSuite", "value": "TestGetUserInfo"}, {"name": "host", "value": "DESKTOP-SI77TGN"}, {"name": "thread", "value": "8976-MainThread"}, {"name": "framework", "value": "pytest"}, {"name": "language", "value": "cpython3"}, {"name": "package", "value": "testcases.api_test.test_01_get_user_info"}]}

View File

@ -0,0 +1,2 @@
[2022-09-05 10:14:58,062][test_01_get_user_info.py 15][INFO]: ********** 开始执行用例 **********
[2022-09-05 10:14:58,062][rest_client.py 55][INFO]: 接口请求地址 ==>> http://119.3.55.6:9999/users

View File

@ -0,0 +1,2 @@
[2022-09-05 10:15:15,394][test_01_get_user_info.py 15][INFO]: ********** 开始执行用例 **********
[2022-09-05 10:15:15,395][rest_client.py 55][INFO]: 接口请求地址 ==>> http://119.3.55.6:9999/users

View File

@ -0,0 +1 @@
{"uuid": "07cb3a19-32f0-464e-ac92-5f58671f7851", "befores": [{"name": "except_code", "status": "passed", "start": 1662344383680, "stop": 1662344383680}], "start": 1662344383680, "stop": 1662344384485}

View File

@ -0,0 +1 @@
<core.result_base.ResultBase object at 0x000001A2B4F3D6A0>

View File

@ -0,0 +1 @@
{"uuid": "19c055c5-6fdb-4170-adb0-52b2d3bb5a7b", "befores": [{"name": "except_msg", "status": "passed", "start": 1662344203575, "stop": 1662344203575}], "start": 1662344203575, "stop": 1662344203676}

View File

@ -0,0 +1 @@
{"name": "test_get_all_user_info[True-0-查询成功]", "status": "passed", "attachments": [{"name": "log", "source": "43896d86-c674-4da2-b88b-f073d2e39a8b-attachment.txt", "type": "text/plain"}, {"name": "stdout", "source": "ff472ed0-f516-48b5-86ae-03c0ac698fab-attachment.txt", "type": "text/plain"}, {"name": "stderr", "source": "c493d670-5042-4710-934a-b48010643fc0-attachment.txt", "type": "text/plain"}], "parameters": [{"name": "except_result", "value": "True"}, {"name": "except_code", "value": "0"}, {"name": "except_msg", "value": "'查询成功'"}], "start": 1662344098063, "stop": 1662344098153, "uuid": "db083826-6e04-4d73-9b77-2fcc52f6daea", "historyId": "8fa120af048dc3f86b08ef0469022873", "testCaseId": "c8c195e0d2fed438fa6bca8fa8984833", "fullName": "testcases.api_test.test_01_get_user_info.TestGetUserInfo#test_get_all_user_info", "labels": [{"name": "parentSuite", "value": "testcases.api_test"}, {"name": "suite", "value": "test_01_get_user_info"}, {"name": "subSuite", "value": "TestGetUserInfo"}, {"name": "host", "value": "DESKTOP-SI77TGN"}, {"name": "thread", "value": "6140-MainThread"}, {"name": "framework", "value": "pytest"}, {"name": "language", "value": "cpython3"}, {"name": "package", "value": "testcases.api_test.test_01_get_user_info"}]}

View File

@ -0,0 +1 @@
{"uuid": "5830940a-cedd-4e56-82ec-cd1b89f277c8", "befores": [{"name": "except_code", "status": "passed", "start": 1662344203575, "stop": 1662344203575}], "start": 1662344203575, "stop": 1662344203684}

View File

@ -0,0 +1,2 @@
[2022-09-05 10:14:21,020][test_01_get_user_info.py 15][INFO]: ********** 开始执行用例 **********
[2022-09-05 10:14:21,020][rest_client.py 55][INFO]: 接口请求地址 ==>> http://119.3.55.6:9999/users

View File

@ -0,0 +1,3 @@
INFO log:test_01_get_user_info.py:15 ********** 开始执行用例 **********
INFO log:rest_client.py:55 接口请求地址 ==>> http://119.3.55.6:9999/users
INFO log:test_01_get_user_info.py:18 接口返回 ==>> {'code': 0, 'data': [{'address': '上海市黄浦区', 'id': 1, 'password': '8fcde9debf630eeee3162b2b70d31082', 'role': 1, 'sex': 1, 'telephone': '13500010005', 'username': 'wintest1'}, {'address': '上海市黄浦区', 'id': 2, 'password': '699423835a085ed49cfc27cb93965149', 'role': 1, 'sex': 1, 'telephone': '13500010006', 'username': 'wintest2'}, {'address': '上海市黄浦区', 'id': 3, 'password': '0228dbb995f3d37a7ea901269d5fa61a', 'role': 1, 'sex': 1, 'telephone': '13500010007', 'username': 'wintest3'}, {'address': '成都市武侯区', 'id': 4, 'password': 'a4d4c12db14629f9711442ddb0d03c57', 'role': 1, 'sex': 0, 'telephone': '13500010004', 'username': 'gq'}, {'address': '深圳市宝安区', 'id': 6, 'password': 'ef0875fbf6504207d1c6d2d6c11ca2c0', 'role': 1, 'sex': 1, 'telephone': '13599999999', 'username': 'wintest4'}], 'msg': '查询成功'}

View File

@ -0,0 +1,3 @@
[2022-09-05 10:20:04,153][test_01_get_user_info.py 15][INFO]: ********** 开始执行用例 **********
[2022-09-05 10:20:04,154][rest_client.py 55][INFO]: 接口请求地址 ==>> http://119.3.55.6:9999/users
[2022-09-05 10:20:04,238][test_01_get_user_info.py 18][INFO]: 接口返回 ==>> {'code': 0, 'data': [{'address': '上海市黄浦区', 'id': 1, 'password': '8fcde9debf630eeee3162b2b70d31082', 'role': 1, 'sex': 1, 'telephone': '13500010005', 'username': 'wintest1'}, {'address': '上海市黄浦区', 'id': 2, 'password': '699423835a085ed49cfc27cb93965149', 'role': 1, 'sex': 1, 'telephone': '13500010006', 'username': 'wintest2'}, {'address': '上海市黄浦区', 'id': 3, 'password': '0228dbb995f3d37a7ea901269d5fa61a', 'role': 1, 'sex': 1, 'telephone': '13500010007', 'username': 'wintest3'}, {'address': '成都市武侯区', 'id': 4, 'password': 'a4d4c12db14629f9711442ddb0d03c57', 'role': 1, 'sex': 0, 'telephone': '13500010004', 'username': 'gq'}, {'address': '深圳市宝安区', 'id': 6, 'password': 'ef0875fbf6504207d1c6d2d6c11ca2c0', 'role': 1, 'sex': 1, 'telephone': '13599999999', 'username': 'wintest4'}], 'msg': '查询成功'}

View File

@ -0,0 +1 @@
<Response [200]>

View File

@ -14,5 +14,4 @@ class TestGetUserInfo():
def test_get_all_user_info(self, except_result, except_code, except_msg):
logger.info("********** 开始执行用例 **********")
result = get_all_user_info()
print(result)
assert result.response.status_code == 200