Pytest
给大家推荐一个好用的python单元测试框架:pytest,支持断点assert操作
#安装pytest
pip install pytest
#安装pytest-html
>pip install pytest-html
#运行pytest命令(可加各参数,有不同意思,此处不拓展)
pytest + 文件名,例:pytest singlelink.py
#将测试结果生成html(默认自动找test_开头的py文件)
pytest --html=report.html
#将测试结果生成html(css包含在html内)
pytest --html=report.html --self-contained-html
console截图:
测试报告html截图:
注:欢迎大家沟通学习,可以但不限于Web,数据结构,操作系统,数据库,中间件等知识