摘要: setup和teardown 分为:模块级,类级,方法级,函数级 setup_module()/teardown_module() setup_function()/teardown_function() setup_class()/teardown_class() setup_method()/t 阅读全文
posted @ 2021-05-10 22:32 huiyii 阅读(161) 评论(0) 推荐(0) 编辑
摘要: pytest.ini配置文件 pytest.ini文件是Pytest的主配置文件,执行测试用例 pytest.ini文件要注意: 存放位置:一般放在项目的根目录(即当前项目的顶级文件夹下)。 编码格式:必须是ANSI编码格式,可以使用notpad++修改编码格式。 pytest.ini文件中不能使用 阅读全文
posted @ 2021-05-10 22:31 huiyii 阅读(231) 评论(0) 推荐(0) 编辑
摘要: 参考 https://www.jianshu.com/nb/49366888 介绍 pytest具有很多第三方插件,并且可以自定义扩展,比较好用的如pytest-selenium(集成selenium)、pytest-html(完美html测试报告生成)、pytest-rerunfailures(失 阅读全文
posted @ 2021-05-10 22:29 huiyii 阅读(89) 评论(0) 推荐(0) 编辑
摘要: 模块 import module1,module2...,导入模块(.py文件)的所有内容 from module import xx,只从模块导入指定部分 from module import *,导入一个模块的所有内容,那些由单一下划线(_)开头的名字不在此例。引入的其它来源的命名,很可能覆盖了 阅读全文
posted @ 2021-05-10 22:28 huiyii 阅读(45) 评论(0) 推荐(0) 编辑
摘要: 基础 标识符 第一个字符必须是字母或下划线 _ 。 标识符的其他的部分由字母、数字和下划线组成 多行语句 如果语句很长,可以使用反斜杠(\)来实现多行语句,例如: total = item_one + \ item_two + \ item_three print print 默认输出是换行的,如果 阅读全文
posted @ 2021-05-10 22:26 huiyii 阅读(52) 评论(0) 推荐(0) 编辑