pytest安装与报错问题以及PyCharm设置


pytest和allure都是单元测试框架

不要点击:https://item.taobao.com/item.htm?id=613711271112

注意:配置文件不能有中文注释也不行,不然会出错,__init__.py文件不能删除,不然会报错。

 

 

 

 

 


def test_login1(self):
print("通过")
assert True

 断言: assert True

1安装导入运行报错安装:pip3 install -u pytest  (-u表示最新版)还需要安装:pip install -u allure-pytest

卸载:pip uninstall pytest

验证:pytest --version

pytest -s login.py(进入当前文件,执行指定login.py文件)

 

 

 验证:

 

 

 

 

 

 

 

 

cmd执行如下命令:

pip uninstall pytest-allure-adaptor
pip install allure-pytest

成功了

 

设置测试程序:

2:

 导入python库。

 

去波浪线:

 

 改字体:

 

 

改变颜色:

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM