摘要: 一. 定义 pytest的fixture中有一个参数scope,它的作用域有五个,分别是:function、class、module、和session function:每个方法开始之前都会调用一次,方法级别 class:每个类开始之前都会调用一次,类级别 module:每个模块(py文件)开始之前 阅读全文
posted @ 2020-04-16 17:09 cnhkzyy 阅读(332) 评论(0) 推荐(0) 编辑
摘要: 在之前的学习中,代码中一直是传入了fixture函数common_driver,又使用了pytest.mark.usefixtures: @pytest.mark.usefixtures("common_driver") def test_welcome(self, common_driver): 阅读全文
posted @ 2020-04-16 15:53 cnhkzyy 阅读(2939) 评论(0) 推荐(0) 编辑
摘要: 之前遇到了很多次类似的问题,即pytest加载conftest.py的时候报如下的错误 我的目录结构是这样的: APP_AutoTest/ |- TestCases/ |- __init__.py |- conftest.py |- test_login.py |- test_welcome.py 阅读全文
posted @ 2020-04-16 12:11 cnhkzyy 阅读(2131) 评论(0) 推荐(0) 编辑