摘要:
setup和teardown 分为:模块级,类级,方法级,函数级 setup_module()/teardown_module() setup_function()/teardown_function() setup_class()/teardown_class() setup_method()/t 阅读全文
posted @ 2021-05-10 22:32
hjy1995
阅读(175)
评论(0)
推荐(0)
摘要:
pytest.ini配置文件 pytest.ini文件是Pytest的主配置文件,执行测试用例 pytest.ini文件要注意: 存放位置:一般放在项目的根目录(即当前项目的顶级文件夹下)。 编码格式:必须是ANSI编码格式,可以使用notpad++修改编码格式。 pytest.ini文件中不能使用 阅读全文
posted @ 2021-05-10 22:31
hjy1995
阅读(289)
评论(0)
推荐(0)
摘要:
参考 https://www.jianshu.com/nb/49366888 介绍 pytest具有很多第三方插件,并且可以自定义扩展,比较好用的如pytest-selenium(集成selenium)、pytest-html(完美html测试报告生成)、pytest-rerunfailures(失 阅读全文
posted @ 2021-05-10 22:29
hjy1995
阅读(101)
评论(0)
推荐(0)
摘要:
import 与 from...import 在 python 用 import 或者 from...import 来导入相应的模块。 将整个模块(somemodule)导入,格式为: import somemodule 从某个模块中导入某个函数,格式为: from somemodule impor 阅读全文
posted @ 2021-05-10 22:28
hjy1995
阅读(53)
评论(0)
推荐(0)
摘要:
基础 标识符 第一个字符必须是字母或下划线 _ 。 标识符的其他的部分由字母、数字和下划线组成 多行语句 如果语句很长,可以使用反斜杠(\)来实现多行语句,例如: total = item_one + \ item_two + \ item_three print print 默认输出是换行的,如果 阅读全文
posted @ 2021-05-10 22:26
hjy1995
阅读(63)
评论(0)
推荐(0)