pytest环境问题

pytest执行时:

Python 3.6.6, pytest-5.2.2, py-1.8.0, pluggy-0.13.0
rootdir: D:\eclipse-workspace
plugins: allure-adaptor-1.7.10, html-2.0.0, metadata-1.8.0, pythonpath-0.7.3

报错:
pluggy.manager.PluginValidationError: unknown hook ‘pytest_namespace’ in plugin

根据网上的资料说是pytest版本过高,要用4.0.2版本

所以重新安装pytest4.0.2。执行又出错:

报错
Requirement already satisfied: zipp>=0.5 in d:\python36\lib\site-packages (from importlib-metadata>=0.12; python_version < “3.8”->pluggy>=0.7->pytest==4.0.2) (0.6.0)
ERROR: pytest-html 2.0.0 has requirement pytest>=5.0, but you’ll have pytest 4.0.2 which is incompatible.

重新安装pytest-html 1.3版本
又出错:
Traceback (most recent call last):
File “d:\python36\lib\runpy.py”, line 193, in run_module_as_main
main”, mod_spec)
File “d:\python36\lib\runpy.py”, line 85, in run_code
exec(code, run_globals)
File "D:\Python36\Scripts\pytest.exe_main
.py", line 7, in
File "d:\python36\lib\site-packages_pytest\config_init
.py", line 58, in main
config = prepareconfig(args, plugins)
File "d:\python36\lib\site-packages_pytest\config_init
.py", line 182, in prepareconfig
config = get_config()
File "d:\python36\lib\site-packages_pytest\config_init
.py", line 153, in get_config
pluginmanager.import_plugin(spec)
File “d:\python36\lib\site-packages_pytest\config_init_.py”, line 522, in import_plugin
import(importspec)
File “d:\python36\lib\site-packages_pytest\tmpdir.py”, line 25, in
class TempPathFactory(object):
File “d:\python36\lib\site-packages_pytest\tmpdir.py”, line 35, in TempPathFactory
lambda p: Path(os.path.abspath(six.text_type§))
TypeError: attrib() got an unexpected keyword argument ‘convert’

先记录一下

你可能感兴趣的:(pytest)