python学习-pytest(一)

馋奶兔 提交于 2020-03-16 08:56:19

学习pytest第一步

一、安装

pytest不是python默认的package,需要手动安装。

pytest支持python 2.6--3.5之间的版本,同时可以在windows、unix系统上安装

安装方式:

pip install pytest

另外,可能会遇到一下问题:

Could not find a version that satisfies the requirement pytest (from versions: )
No matching distribution found for pytest

解决办法:主要是国内网络问题,所以使用豆瓣源安装
pip install 包名 -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
示例:pip3 install pytest-html -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com

安装完成后,可以查看版本:

pytest --version

参考文章:https://blog.csdn.net/yxxxiao/article/details/94591174

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!