请问这个要怎么解决啊?
C:\python36\python.exe "C:\Program Files\JetBrains\PyCharm 2018.3.3\helpers\pydev\pydevd.py" --multiproc --qt-support=auto --client 127.0.0.1 --port 3799 --file K:/workspace/YamlAppium-master/run.py
pydev debugger: process 5692 is connecting
Connected to pydev debugger (build 183.5153.39)
============================= test session starts =============================
platform win32 -- Python 3.8.2, pytest-5.4.2, py-1.8.1, pluggy-0.13.1 -- C:\python36\python.exe
cachedir: .pytest_cache
metadata: {'Python': '3.8.2', 'Platform': 'Windows-7-6.1.7601-SP1', 'Packages': {'pytest': '5.4.2', 'py': '1.8.1', 'pluggy': '0.13.1'}, 'Plugins': {'allure-pytest': '2.8.33', 'Faker': '4.14.0', 'html': '2.1.1', 'metadata': '1.10.0'}, 'JAVA_HOME': 'C:\jdk1.8'}
rootdir: K:\
plugins: allure-pytest-2.8.33, Faker-4.14.0, html-2.1.1, metadata-1.10.0
collecting ... collected 1 item
tests\test_case\test_search.yml::test_search ERROR [100%]
=================================== ERRORS ====================================
___________________ ERROR at setup of CaseName: test_search ___________________
cls =
func = . at 0x000000000DF8B5E0>
when = 'setup'
reraise = (, )
@classmethod
def from_call(cls, func, when, reraise=None) -> "CallInfo":
#: context of invocation: one of "setup", "call",
#: "teardown", "memocollect"
start = time()
excinfo = None
try:
result = func()
C:\python36\lib\site-packages_pytest\runner.py:244:
lambda: ihook(item=item, **kwds), when=when, reraise=reraise
)
C:\python36\lib\site-packages_pytest\runner.py:217:
self = <_HookCaller 'pytest_runtest_setup'>, args = ()
kwargs = {'item': }, notincall = set()
def call(self, *args, **kwargs):
if args:
raise TypeError("hook calling supports only keyword arguments")
assert not self.is_historic()
if self.spec and self.spec.argnames:
notincall = (
set(self.spec.argnames) - set(["multicall"]) - set(kwargs.keys())
)
if notincall:
warnings.warn(
"Argument(s) {} which are declared in the hookspec "
"can not be found in this hook call".format(tuple(notincall)),
stacklevel=2,
)
return self._hookexec(self, self.get_hookimpls(), kwargs)
C:\python36\lib\site-packages\pluggy\hooks.py:286:
self = <_pytest.config.PytestPluginManager object at 0x000000000B63E400>
hook = <_HookCaller 'pytest_runtest_setup'>
methods = [>, >]
kwargs = {'item': }
def _hookexec(self, hook, methods, kwargs):
# called from all hookcaller instances.
# enable_tracing will set its own wrapping function at self._inner_hookexec
return self._inner_hookexec(hook, methods, kwargs)
C:\python36\lib\site-packages\pluggy\manager.py:93:
hook = <_HookCaller 'pytest_runtest_setup'>
methods = [>, >]
kwargs = {'item': }
self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall(
methods,
kwargs,
firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
)
C:\python36\lib\site-packages\pluggy\manager.py:84:
hook_impls = [>, >]
caller_kwargs = {'item': }, firstresult = False
def _multicall(hook_impls, caller_kwargs, firstresult=False):
"""Execute a call into multiple python functions/methods and return the
result(s).
caller_kwargs
comes from HookCaller.call().
"""
__tracebackhide_ = True
results = []
excinfo = None
try: # run impl and wrapper setup functions in a loop
teardowns = []
try:
for hook_impl in reversed(hook_impls):
try:
args = [caller_kwargs[argname] for argname in hook_impl.argnames]
except KeyError:
for argname in hook_impl.argnames:
if argname not in caller_kwargs:
raise HookCallError(
"hook call must provide argument %r" % (argname,)
)
if hook_impl.hookwrapper:
try:
gen = hook_impl.function(*args)
next(gen) # first yield
teardowns.append(gen)
except StopIteration:
_raise_wrapfail(gen, "did not yield")
else:
res = hook_impl.function(*args)
if res is not None:
results.append(res)
if firstresult: # halt further impl calls
break
except BaseException:
excinfo = sys.exc_info()
finally:
if firstresult: # first result hooks return a single value
outcome = _Result(results[0] if results else None, excinfo)
else:
outcome = _Result(results, excinfo)
# run all wrapper post-yield blocks
for gen in reversed(teardowns):
try:
gen.send(outcome)
C:\python36\lib\site-packages\pluggy\callers.py:203:
self =
item =
@pytest.hookimpl(hookwrapper=True)
def pytest_runtest_setup(self, item):
if not self._cache.get(item.nodeid):
uuid = self._cache.push(item.nodeid)
test_result = TestResult(name=item.name, uuid=uuid, start=now(), stop=now())
self.allure_logger.schedule_test(uuid, test_result)
yield
uuid = self._cache.get(item.nodeid)
test_result = self.allure_logger.get_test(uuid)
for fixturedef in _test_fixtures(item):
c:\python36\lib\site-packages\allure_pytest\listener.py:79:
item =
def _test_fixtures(item):
fixturemanager = item.session._fixturemanager
fixturedefs = []
if hasattr(item._request, "fixturenames"):
E AttributeError: 'YamlTest' object has no attribute '_request'
c:\python36\lib\site-packages\allure_pytest\listener.py:282: AttributeError
============================== warnings summary ===============================
tests\conftest.py:42
K:\workspace\YamlAppium-master\tests\conftest.py:42: PytestDeprecationWarning: direct construction of YamlFile has been deprecated, please use YamlFile.from_parent
return YamlFile(path, parent)
tests\conftest.py:51
K:\workspace\YamlAppium-master\tests\conftest.py:51: PytestDeprecationWarning: direct construction of YamlTest has been deprecated, please use YamlTest.from_parent
yield YamlTest(name, self, values)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=========================== short test summary info ===========================
ERROR tests\test_case\test_search.yml::test_search - AttributeError: 'YamlTes...
================== 2 warnings, 1 error in 103.70s (0:01:43) ===================
Process finished with exit code 0