pytest 安装
安装前置条件
Pythons:pytest要求:Python 3.6、3.7、3.8、3.9或PyPy3。
安装
建议使用虚拟环境 ,在虚拟环境中安装pytest,以满足项目对不同版本插件的需求
虚拟环境安装见:
https://blog.youkuaiyun.com/qq_28825969/article/details/115956954?spm=1001.2014.3001.5501
也可参考https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/#creating-a-virtual-environment
安装pytest :
官方文档地址:https://docs.pytest.org
pip install -U pytest #默认安装最近的版本
pip install -U pytest==6.2.2 #安装指定版本的pytest
验证安装是否成功
pytest --version
安装成功后: