代码如下:

报错信息:
platform win32 -- Python 3.7.3, pytest-3.0.7, py-1.8.0, pluggy-0.4.0
rootdir: D:\Python\test\uu, inifile:
plugins: ordering-0.6
collected 1 itemsINTERNALERROR> Traceback (most recent call last):
INTERNALERROR> File "C:\Users\Administrator\AppData\Roaming\Python\Python37\site-packages_pytest\main.py", line 98, in wrap_session
INTERNALERROR> session.exitstatus = doit(config, session) or 0
INTERNALERROR> File "C:\Users\Administrator\AppData\Roaming\Python\Python37\site-packages_pytest\main.py", line 132, in main
INTERNALERROR> config.hook.pytest_collection(session=session)
INTERNALERROR> File "C:\Users\Administrator\AppData\Roaming\Python\Python37\site-packages_pytest\vendored_packages\pluggy.py", line 745, in __call
_
INTERNALERROR> return self.hookexec(self, self._nonwrappers + self._wrappers, kwargs)
INTERNALERROR> File "C:\Users\Administrator\AppData\Roaming\Python\Python37\site-packages_pytest\vendored_packages\pluggy.py", line 339, in _hookexec
INTERNALERROR> return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR> File "C:\Users\Administrator\AppData\Roaming\Python\Python37\site-packages_pytest\vendored_packages\pluggy.py", line 334, in
INTERNALERROR> _MultiCall(methods, kwargs, hook.spec_opts).execute()
INTERNALERROR> File "C:\Users\Administrator\AppData\Roaming\Python\Python37\site-packages_pytest\vendored_packages\pluggy.py", line 614, in execute
INTERNALERROR> res = hook_impl.function(*args)
INTERNALERROR> File "C:\Users\Administrator\AppData\Roaming\Python\Python37\site-packages_pytest\main.py", line 141, in pytest_collection
INTERNALERROR> return session.perform_collect()
INTERNALERROR> File "C:\Users\Administrator\AppData\Roaming\Python\Python37\site-packages_pytest\main.py", line 602, in perform_collect
INTERNALERROR> config=self.config, items=items)
INTERNALERROR> File "C:\Users\Administrator\AppData\Roaming\Python\Python37\site-packages_pytest\vendored_packages\pluggy.py", line 745, in __call
_
INTERNALERROR> return self.hookexec(self, self._nonwrappers + self._wrappers, kwargs)
INTERNALERROR> File "C:\Users\Administrator\AppData\Roaming\Python\Python37\site-packages_pytest\vendored_packages\pluggy.py", line 339, in _hookexec
INTERNALERROR> return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR> File "C:\Users\Administrator\AppData\Roaming\Python\Python37\site-packages_pytest\vendored_packages\pluggy.py", line 334, in
INTERNALERROR> _MultiCall(methods, kwargs, hook.spec_opts).execute()
INTERNALERROR> File "C:\Users\Administrator\AppData\Roaming\Python\Python37\site-packages_pytest\vendored_packages\pluggy.py", line 614, in execute
INTERNALERROR> res = hook_impl.function(*args)
INTERNALERROR> File "C:\Python37\lib\site-packages\pytest_ordering__init
_.py", line 45, in pytest_collection_modifyitems
INTERNALERROR> mark = item.get_closest_marker(mark_name)
INTERNALERROR> AttributeError: 'TestCaseFunction' object has no attribute 'get_closest_marker'
请大神们指点下


↙↙↙阅读原文可查看相关链接,并与作者交流