随笔分类 -  接口自动化

摘要:##1. curl介绍 CURL,全称Command Line URL Viewer,是一个Linux命令行工具,能从服务器下载数据,也能往服务器上发送数据,支持多种协议。 Postman和浏览器在给服务器发送请求时,会接收一个cookies,再次发送请求的时候,会默认将cookies一起发送出去。 阅读全文
posted @ 2022-01-20 16:29 焰红火 阅读(750) 评论(0) 推荐(0)
摘要:第三方库CSV中提供了2个类来写CSV文件 csv.writer class csv.writer class provides two methods for writing to CSV. They are writerow() and writerows(). writerow(): This 阅读全文
posted @ 2022-01-17 17:09 焰红火 阅读(88) 评论(0) 推荐(0)
摘要:pytest fixture 1. 通过conftest.py 共享fixture @pytest.fixture()装饰器用于声明函数是一个fixture,如果测试用例的参数列表中包含fixture, pytest会优先搜索该测试用例所在的模块,然后搜索conftest.py文件。 conftes 阅读全文
posted @ 2022-01-09 20:20 焰红火 阅读(98) 评论(0) 推荐(0)
摘要:测试文件的命名规则 1.测试文件应该命名为test_<something>.py或者<something>_test.py 2.测试类应该命名为Test<something>.py 3.测试函数和测试类方法应该命名为test_<something> Pytest 基础命令 pytest --hlep 阅读全文
posted @ 2022-01-08 20:55 焰红火 阅读(73) 评论(0) 推荐(0)
摘要:##读写Excel文件 xls 是Excel 2007之前的版本,xlsx 是Excel 2007之后的版本,xlrd和xlwt 是用于较老的版本 openpyxl是官方推荐使用的第三方库.如果在Excel文件中插入图片之类的,需要pip install pillow # 读取Excel文件 imp 阅读全文
posted @ 2022-01-07 14:34 焰红火 阅读(149) 评论(0) 推荐(0)