上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 65 下一页
摘要: 阅读全文
posted @ 2023-08-03 10:03 胖豆芽 阅读(8) 评论(0) 推荐(0) 编辑
摘要: [pytest] testpaths = ./test_case/test_params.py addopts = -vs --alluredir ./report import pytest import requests from utils.read_yaml import get_yaml_ 阅读全文
posted @ 2023-08-02 22:00 胖豆芽 阅读(84) 评论(0) 推荐(0) 编辑
摘要: import pytest import requests from utils.read_yaml import get_yaml_data # 多个参数(’class1,class2‘,[('age','eat'),('age','eat')]) @pytest.mark.parametrize 阅读全文
posted @ 2023-08-02 21:16 胖豆芽 阅读(125) 评论(0) 推荐(0) 编辑
摘要: import pytest # 多个参数(’class1,class2‘,[('age','eat'),('age','eat')]) @pytest.mark.parametrize('dog,cat',[('2','bone'),('1','fish')]) def test_params(do 阅读全文
posted @ 2023-08-02 20:45 胖豆芽 阅读(16) 评论(0) 推荐(0) 编辑
摘要: 上图示例 def setup_module(): print('准备测试数据') def teardown_module(): print('清理测试数据') def test_one(): ex=1 real=1 assert ex==real 仅在模块中执行一次 阅读全文
posted @ 2023-08-02 18:09 胖豆芽 阅读(26) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2023-08-02 18:06 胖豆芽 阅读(4) 评论(0) 推荐(0) 编辑
摘要: import requests HOST = 'https://ip.com' URL = '/posts/' url=HOST+URL jsons={# 尽量不要使用json作为变量 防止和json关键字冲突 "title": "foo", "body":" bar", "userId": 1 } 阅读全文
posted @ 2023-08-02 13:18 胖豆芽 阅读(23) 评论(2) 推荐(0) 编辑
摘要: class BaseAPI: # 基类 相当于动物类 ; 登录 属于继承类,相当于老虎类 # 属性 def __init__(self,token=None): # 店铺类,订单类,支付模块等都需要使用token 所以过滤一下 if token:# 如果接口需要token 店铺类,订单类,支付模块等 阅读全文
posted @ 2023-08-02 12:13 胖豆芽 阅读(11) 评论(0) 推荐(0) 编辑
摘要: import requests from http.client import HTTPConnection HTTPConnection.debuglevel=1 import requests # 请求url url = "http://ip:port/file" # 请求头 headers = 阅读全文
posted @ 2023-08-01 20:15 胖豆芽 阅读(218) 评论(0) 推荐(0) 编辑
摘要: json.loads()函数只能将一个合法的JSON字符串转换为相应的Python对象(例如字典、列表等)。它无法处理包含多个JSON字符串的字符串 第一种str='{"code": 9999, "data": "", "flag": "11", "msg": "该用户不存在!", "success 阅读全文
posted @ 2023-07-30 18:33 胖豆芽 阅读(954) 评论(2) 推荐(0) 编辑
上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 65 下一页