pytest运行报错nknown hook 'pytest_namespace' in plugin <module 'allure.pytest_plugin'

pytest运行报错

INTERNALERROR> pluggy.manager.PluginValidationError: unknown hook 'pytest_namespace' in plugin <module 'allure.pytest_plugin' from '/usr/local/lib/python3.7/site-packages/allure/pytest_plugin.py'>

 

法一:

可以先尝试卸载pytest-allure-adaptor,然后再安装allure-pytest

pip3 uninstall pytest-allure-adaptor

pip3 install allure-pytest

然后查看allure版本

法二:

如果法一没有用,再尝试用法二

经查询,原因是pytest版本过高导致的

卸载已有的pytest

pip uninstall pytest

指定安装pytest4.0.2版本:

pip install pytest==4.0.2

原文地址:https://www.cnblogs.com/may18/p/13336581.html