测试人社区

pycharm 2018环境运行pytest报错是啥原因

Testing started at 15:12 …
C:\Users\mhl\PycharmProjects\mhlpytest\venv\Scripts\python.exe “C:\Program Files\JetBrains\PyCharm 2018.2.4\helpers\pycharm_jb_pytest_runner.py” --path C:/Users/mhl/PycharmProjects/mhlpytest/com/demo/autotest/test_pytestdemo.py
Launching pytest with arguments C:/Users/mhl/PycharmProjects/mhlpytest/com/demo/autotest/test_pytestdemo.py in C:\Users\mhl\PycharmProjects\mhlpytest\com\demo\autotest

Traceback (most recent call last):
File “C:\Program Files\JetBrains\PyCharm 2018.2.4\helpers\pycharm_jb_pytest_runner.py”, line 31, in
pytest.main(args, plugins_to_load)
File “C:\Users\mhl\PycharmProjects\mhlpytest\venv\lib\site-packages_pytest\config_init_.py”, line 55, in main
config = prepareconfig(args, plugins)
File "C:\Users\mhl\PycharmProjects\mhlpytest\venv\lib\site-packages_pytest\config_init
.py", line 200, in _prepareconfig
pluginmanager=pluginmanager, args=args
File “C:\Users\mhl\PycharmProjects\mhlpytest\venv\lib\site-packages\pluggy\hooks.py”, line 289, in call
return self._hookexec(self, self.get_hookimpls(), kwargs)
File “C:\Users\mhl\PycharmProjects\mhlpytest\venv\lib\site-packages\pluggy\manager.py”, line 87, in _hookexec
return self.inner_hookexec(hook, methods, kwargs)
File “C:\Users\mhl\PycharmProjects\mhlpytest\venv\lib\site-packages\pluggy\manager.py”, line 81, in
firstresult=hook.spec.opts.get(“firstresult”) if hook.spec else False,
File “C:\Users\mhl\PycharmProjects\mhlpytest\venv\lib\site-packages\pluggy\callers.py”, line 203, in multicall
gen.send(outcome)
File “C:\Users\mhl\PycharmProjects\mhlpytest\venv\lib\site-packages_pytest\helpconfig.py”, line 89, in pytest_cmdline_parse
config = outcome.get_result()
File “C:\Users\mhl\PycharmProjects\mhlpytest\venv\lib\site-packages\pluggy\callers.py”, line 80, in get_result
raise ex[1].with_traceback(ex[2])
File “C:\Users\mhl\PycharmProjects\mhlpytest\venv\lib\site-packages\pluggy\callers.py”, line 187, in multicall
res = hook_impl.function(*args)
File "C:\Users\mhl\PycharmProjects\mhlpytest\venv\lib\site-packages_pytest\config_init
.py", line 661, in pytest_cmdline_parse
self.parse(args)
File "C:\Users\mhl\PycharmProjects\mhlpytest\venv\lib\site-packages_pytest\config_init
.py", line 869, in parse
self.preparse(args, addopts=addopts)
File "C:\Users\mhl\PycharmProjects\mhlpytest\venv\lib\site-packages_pytest\config_init
.py", line 815, in preparse
self.pluginmanager.load_setuptools_entrypoints(“pytest11”)
File “C:\Users\mhl\PycharmProjects\mhlpytest\venv\lib\site-packages\pluggy\manager.py”, line 292, in load_setuptools_entrypoints
plugin = ep.load()
File "C:\Users\mhl\PycharmProjects\mhlpytest\venv\lib\site-packages\importlib_metadata_init
.py", line 90, in load
module = import_module(match.group(‘module’))
File "C:\Python37\lib\importlib_init
.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 1006, in _gcd_import
File “”, line 983, in _find_and_load
File “”, line 967, in _find_and_load_unlocked
File “”, line 677, in _load_unlocked
File “C:\Users\mhl\PycharmProjects\mhlpytest\venv\lib\site-packages_pytest\assertion\rewrite.py”, line 149, in exec_module
exec(co, module.dict)
File “c:\users\mhl\pycharmprojects\mhlpytest\venv\lib\site-packages\marks\marks.py”, line 2, in
from _pytest.mark import MarkInfo
ImportError: cannot import name ‘MarkInfo’ from 'pytest.mark’ (C:\Users\mhl\PycharmProjects\mhlpytest\venv\lib\site-packages_pytest\mark_init.py)

Process finished with exit code 1
Empty test suite.

文件名与依赖包重复了,看下目录结构