pytest-sugar使用


无他,主要是安装了pytest-sugar之后,使用pytest运行代码,风格依然没有变化,在此记录一下

1. 安装pytest-sugar

pip install pytest-sugar

2. 运行

安装完成后,通过pytest运行代码,sugar不生效,查看pytest-sugar官方文档: https://pypi.org/project/pytest-sugar/

发现pytest-sugar需要有其他依赖(共3个):

  • Python 2.7, 3.4 or newer

  • pytest2.9.0 or newer

  • pytest-xdist 1.14 or above if you want the progress bar to work while running tests in parallel

我运行不生效的原因是:没有安装pytest-xdist,安装后,运行生效

3.不使用sugar用法:

py.test -p no:sugar

posted on 2021-01-06 11:21  多多洛~吖  阅读(1165)  评论(0)    收藏  举报