上一页 1 ··· 25 26 27 28 29 30 31 32 33 ··· 60 下一页
摘要: 1. csv 写入 CSV文件写入第一种方式:列表第二种方式:字典 1.1 列表 ''' csv文件写入 第一种方式:列表 第二种方式:字典 ''' import csv header = ['学号', '姓名', "年龄", "性别", "地址"] student_info = [ ['01', 阅读全文
posted @ 2021-09-02 12:52 Avicii_2018 阅读(332) 评论(0) 推荐(0)
摘要: 示例: # -*-encoding: utf-8 -*- ''' 多个测试用例执行, 但是每个用例 对初始化和清除 的要求不同 ,可以使用@pytest.fixture() fixture(scope='',params=None,autouse=False,ids=None,name=None) 阅读全文
posted @ 2021-08-31 00:13 Avicii_2018 阅读(46) 评论(0) 推荐(0)
摘要: 示例: # -*-coding: utf-8 -*- from selenium import webdriver import pytest import time search_list = ['小米','小米手机','小米10s','红米','耳机'] def setup_module(): 阅读全文
posted @ 2021-08-30 21:55 Avicii_2018 阅读(63) 评论(0) 推荐(0)
摘要: 示例: # -*- coding: utf-8 -*- ''' 业务逻辑相同,输入参数量较大, 使用 pyetst内置装饰器@pytest.mark.parametrize('参数名',参数列表) ''' import pytest @pytest.mark.parametrize('x,y',[( 阅读全文
posted @ 2021-08-30 20:49 Avicii_2018 阅读(55) 评论(0) 推荐(0)
摘要: 编写规则: 测试文件以test_开头(以_test结尾也可以) 测试类以Test开头,并且不能带有 init 方法 测试用例方法以test_开头 断言使用基本的assert即可 示例 : test_pyexample.py import pytest class TestClass: def tes 阅读全文
posted @ 2021-08-26 12:46 Avicii_2018 阅读(80) 评论(0) 推荐(0)
上一页 1 ··· 25 26 27 28 29 30 31 32 33 ··· 60 下一页