摘要:
1、setup\teardown 运行级别 模块级别(setup_module/teardown_module):开始于模块始末,全局的 函数级(setup_function/teardown_function):对函数用例生效(不在类中) 类级(setup_class/teardown_class 阅读全文
摘要:
直接上代码吧~~~~ # File : test_demo_2.py # IDE : PyCharm import pytest def setup_function(): print('*' * 10 +'用例开始!'+ '*' * 10) def teardown_function(): pri 阅读全文
摘要:
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 阅读全文