python学习-pytest(一)

学习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

猜你喜欢

转载自www.cnblogs.com/zhaocbbb/p/12501701.html
今日推荐