使用pytest通过cmd运行测试时出现错误:INTERNALERROR> AttributeError:'Config'对象没有属性'_metadata'

时间:2020-10-10 17:14:22

标签: python selenium pytest

运行此命令:pytest -v -s -m“ sanity”-浏览器镶边
“健全性”是为pytest定义的组,用于运行属于同一组的多个测试用例

C:\Users\orange\PycharmProjects\PythonHybridFramework>pytest -v -s -m "sanity" --browser chrome
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "c:\users\orange\appdata\local\programs\python\python38-32\lib\site-packages\_pytest\main.py", line 253, in wrap_session
INTERNALERROR>     config._do_configure()
INTERNALERROR>   File "c:\users\orange\appdata\local\programs\python\python38-32\lib\site-packages\_pytest\config\__init__.py", line 982, in _do_configure
INTERNALERROR>     self.hook.pytest_configure.call_historic(kwargs=dict(config=self))
INTERNALERROR>   File "c:\users\orange\appdata\local\programs\python\python38-32\lib\site-packages\pluggy\hooks.py", line 308, in call_historic
INTERNALERROR>     res = self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR>   File "c:\users\orange\appdata\local\programs\python\python38-32\lib\site-packages\pluggy\manager.py", line 93, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "c:\users\orange\appdata\local\programs\python\python38-32\lib\site-packages\pluggy\manager.py", line 84, in <lambda>
INTERNALERROR>     self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall(
INTERNALERROR>   File "c:\users\orange\appdata\local\programs\python\python38-32\lib\site-packages\pluggy\callers.py", line 208, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "c:\users\orange\appdata\local\programs\python\python38-32\lib\site-packages\pluggy\callers.py", line 80, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "c:\users\orange\appdata\local\programs\python\python38-32\lib\site-packages\pluggy\callers.py", line 187, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "C:\Users\orange\PycharmProjects\PythonHybridFramework\testCases\conftest.py", line 36, in pytest_configure
INTERNALERROR>     config._metadata['Project Name'] = 'Test Project'
INTERNALERROR> AttributeError: 'Config' object has no attribute '_metadata'

0 个答案:

没有答案