一、单元测试
unittest
说明:unittest是Python内置的单元测试框架
官方文档:https://docs.python.org/3/library/unittest.html
pytest
说明:pytest是一款功能更为强大的单元测试框架
pypi:https://pypi.org/project/pytest/
官方文档:https://docs.pytest.org/en/7.2.x/
nose2
说明:nose2是unittest的扩展,可以让测试更容易理解
pypi:https://pypi.org/project/nose2/
官方文档:https://docs.nose2.io/en/latest/
ddt
说明:数据驱动测试
pypi:https://pypi.org/project/ddt/
parameterized
说明:参数化
pypi:https://pypi.org/project/parameterized/
xtestrunner
说明:基于unittest的测试报告
pypi:https://pypi.org/project/xtestrunner/
allure-pytest
说明:基于pytest的测试报告
pypi:https://pypi.org/project/allure-pytest/
官方文档:https://docs.qameta.io/allure-report/
utx
说明:utx扩展了unittest,主要实现了按用例编写顺序进行执行的功能。
GitHub:https://github.com/jianbing/utx
二、BDD(行为驱动开发)
behave
pypi:https://pypi.org/project/behave/
官方文档:https://behave.readthedocs.io/en/latest/
Pytest-BDD
pypi:https://pytest-bdd.readthedocs.io/en/latest/
三、自动化测试
Requests
说明:接口测试
官方文档:https://requests.readthedocs.io/en/latest/
selenium
说明:Web自动化测试
pypi:https://pypi.org/project/selenium/
官方文档:https://www.selenium.dev/documentation/
Appium-Python-Client
说明:手机自动化测试
官方文档:http://appium.io/docs/en/2.0/
pypi:https://pypi.org/project/Appium-Python-Client/
MiniTest
说明:小程序自动化测试
官方文档:https://minitest.weixin.qq.com/#/minium/Python/api/Page
Locust
说明:性能测试
官方文档:https://docs.locust.io/en/stable/
四、其它
allpairspy
说明:正交法设计测试用例
pypi:https://pypi.org/project/allpairspy/
以上就是一些常用的Python测试框架,后续将持续补充。
如有什么意见与建议,请在评论区留言吧!
如果你觉得文章对你有一点点帮助,烦请各位动动小手,点赞、关注、收藏!谢谢!