摘要: 参数化表达式: ddt表达式 @pytest.mark.parametrize(“参数名”, 列表数据) @ddt.ddt def(参数名): class xxx(unittest.TestCase): #一定要继承unitest.TestCase 执行体 @ddt.data(*LD.wrong_d 阅读全文
posted @ 2020-08-12 18:19 菜鸟到大佬 阅读(1101) 评论(0) 推荐(0) 编辑
摘要: pytest fixture超级灵活 缺乏百度文档学习,很多骚操作(继承、共享……),面试也爱问,多看多写。 前后置条件公式: @pytest.fixture #无参则默认为函数级别,可带参数 加上:(scope=”class”/”module”/”session”, auto=True) Def 阅读全文
posted @ 2020-08-12 18:08 菜鸟到大佬 阅读(1238) 评论(0) 推荐(0) 编辑
摘要: 我的路径配置文件如下: import os#框架项目顶层目录base_dir = os.path.split(os.path.split(os.path.abspath(__file__))[0])[0]print(base_dir)testdatas_dir = os.path.join(base 阅读全文
posted @ 2020-08-12 17:58 菜鸟到大佬 阅读(1210) 评论(0) 推荐(0) 编辑