pytest+allure环境别人电脑运行正常,自己运行不正常几种情况
生活随笔
收集整理的這篇文章主要介紹了
pytest+allure环境别人电脑运行正常,自己运行不正常几种情况
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
1. AttributeError:'module’ object has no attribute 'severity_level'
之前運行都是正常的,想弄allure報告,就使用pip install allure-pytest 命令安裝了,其實該命令的作用是會把你當前版本的pytest卸載掉,然后安裝
allure-python-commons,pytest,allure-pytest 最新版本;執(zhí)行時就會出以上問題;??
然后我以為是allure的問題就把allure-python-commons 以及allure-pytest卸載了,再運行就出現(xiàn)了問題2
2.?pluggy.manager.PluginValidationError: unknown hook 'pytest_namespace' in plugin <module 'allure.pytest_plugin' from 'd:\\python
\\lib\\site-packages\\allure\\pytest_plugin.py'>
其實以上兩個問題根本原因都是同一個,pytest的版本導致的,pytest版本太新。 使用舊版本就可以解決了,切換版本步驟如下:
首先卸載新版本pytest: pip uninstall pytest
安裝制定版本(可以安裝你升級之前的版本),我用的是3.8.0 pip install pytest==3.8.0
安裝后再次執(zhí)行就可以啦!
轉(zhuǎn)載于:https://www.cnblogs.com/wclcz/p/11398113.html
總結(jié)
以上是生活随笔為你收集整理的pytest+allure环境别人电脑运行正常,自己运行不正常几种情况的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 检查阳痿原因去男科医院,还是去三甲医院,
- 下一篇: 幻彩流光翼,幻仙孔雀皇冠,幻彩光效的音乐