一:pythest命名规则
1.测试文件名必须为test_开头或_test结尾,例如:test_Add.py 或 Add_test.py
2.测试函数、测试类方法应该命名为test_Function或test_Method,例如:test_Add()
3.测试类须命令为Test,例如:TestPerson()
1.1pytest运行指定模块下,运行所有test开头的类和测试用
1.2运行指定模块指定类指定用例,冒号分割,并生成测试报告
1.3直接执行pytest.main() 【自动查找当前目录下,以test开头的文件或者以test结尾的py文件】
二:Pytest调用语句
三:Pytest的运行方式
四:文件读取
4.1:读取csv文件
4.2:读取xml文件
五:allure
首先配置allure的环境变量
验证allure是否配置成功
其次要安装allure
5.1:Allure常用的几个特性
5.1.1:allure.feature
5.1.2:allure.story
5.1.3:with allure.step()
5.1.4:allure.attach