pytest 集成PO设计模式实例
1.pytest基础:
环境:
python3 + pycharm
组成结构:
测试模块
模块名字符合test_xxxx或者xxxx_test的py文件
测试用例
测试模块或者测试类里面符合命名符合test_xxxx函数或者实例函数
测试类
测试模块里的类命名符合Test_xxxx的类
pytest运行方式:
1.全量方式运行: pytest 测试py文件
2.部分方法运行: pytest test_mod.py::test_func
3.运行时显示详细日志: pytest test_mod.py::test_func -v -s

浙公网安备 33010602011771号