--------------------------------Pytest编写用例------------------------------------
①用例文件:test开头
②以test开头的函数会当成一条测试用例
③以Test开头的类会当成测试用例类
测试类中,以test开头的方法,会当成一条测试用例
Pytest配置文件:执行pytest时会根据pytest.ini中定义规则来执行用例
自定义pytest识别用例规则:在run.py文件同级目录中新建pytest.ini
[pytest]
python_files=
test_*.py #test开头py文件
check_*.py #check开头py文件
example_*.py #example开头py文件
python_functions=*_test #test结尾函数
python_classes=*suite #包含Suite类