摘要:
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
胖豆芽
阅读(183)
评论(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
胖豆芽
阅读(33)
评论(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
胖豆芽
阅读(43)
评论(0)
推荐(0)
摘要:
阅读全文
posted @ 2023-08-02 18:06
胖豆芽
阅读(25)
评论(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
胖豆芽
阅读(41)
评论(2)
推荐(0)
摘要:
class BaseAPI: # 基类 相当于动物类 ; 登录 属于继承类,相当于老虎类 # 属性 def __init__(self,token=None): # 店铺类,订单类,支付模块等都需要使用token 所以过滤一下 if token:# 如果接口需要token 店铺类,订单类,支付模块等 阅读全文
posted @ 2023-08-02 12:13
胖豆芽
阅读(34)
评论(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
胖豆芽
阅读(514)
评论(0)
推荐(0)
浙公网安备 33010602011771号