摘要: 1、setup\teardown 运行级别 模块级别(setup_module/teardown_module):开始于模块始末,全局的 函数级(setup_function/teardown_function):对函数用例生效(不在类中) 类级(setup_class/teardown_class 阅读全文
posted @ 2020-08-17 14:56 子非鱼焉知鱼之乐丶 阅读(322) 评论(0) 推荐(1) 编辑
摘要: 直接上代码吧~~~~ # File : test_demo_2.py # IDE : PyCharm import pytest def setup_function(): print('*' * 10 +'用例开始!'+ '*' * 10) def teardown_function(): pri 阅读全文
posted @ 2020-08-17 14:16 子非鱼焉知鱼之乐丶 阅读(537) 评论(0) 推荐(1) 编辑
摘要: pytest 官方API说明:https://docs.pytest.org/en/latest/reference.html 1、pytest安装: pip install -U pytest -i https://pypi.tuna.tsinghua.edu.cn/simple 2、pytest 阅读全文
posted @ 2020-08-17 10:37 子非鱼焉知鱼之乐丶 阅读(858) 评论(0) 推荐(2) 编辑