随笔分类 -  Pytest

pytest(用例的setup和teardown)
摘要:用例运行级别 模块级(setup_module/teardown_module)开始于模块始末,全局的 函数级(setup_function/teardown_function)只对函数用例生效(不在类中) 类级(setup_class/teardown_class)只在类中前后运行一次(在类中) 阅读全文

posted @ 2020-12-14 11:33 Tester十点半 阅读(286) 评论(0) 推荐(0)

pytest(环境准备)
摘要:1、安装 pip install -U pytest 2、pytest用例规则 测试文件以test_开头或以_test结尾 测试类以Test开头,并且不能带有 __init__ 方法 测试函数以test_开头 断言使用assert 可在ini文件中修改 3、用例设计规则 文件名以test_*.py文 阅读全文

posted @ 2020-11-11 14:31 Tester十点半 阅读(116) 评论(0) 推荐(0)

导航