首页 > 其他 > 详细

pytest别人电脑运行正常,自己运行不正常几种情况

时间:2019-08-23 09:41:17      阅读:1445      评论:0      收藏:0      [点我收藏+]

1. AttributeError:‘module’ object has no attribute ‘severity_level‘

技术分享图片

之前运行都是正常的,想弄allure报告,就使用pip install allure-pytest 命令安装了,其实该命令的作用是会把你当前版本的pytest卸载掉,然后安装

allure-python-commons,pytest,allure-pytest 最新版本;执行时就会出以上问题;  

然后我以为是allure的问题就把allure-python-commons 以及allure-pytest卸载了,再运行就出现了问题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

安装后再次执行就可以啦!

pytest别人电脑运行正常,自己运行不正常几种情况

原文:https://www.cnblogs.com/wclcz/p/11398113.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!