pytest-dev / pytest-forked

extracted --boxed from pytest-xdist to ensure backward compat
MIT License
62 stars 21 forks source link

AttributeError: 'Function' object has no attribute '_getfslineno' #30

Closed blueyed closed 4 years ago

blueyed commented 4 years ago

_getfslineno has been removed in pytest in https://github.com/pytest-dev/pytest/commit/16546b734

===================================== test session starts ======================================
platform linux -- Python 3.8.2, pytest-5.3.5.dev883+g03dca1aeb.d20200326, py-1.8.2.dev5+g043b5868.d20200315, pluggy-0.13.2.dev20+g6e8b6d4.d20200311
rootdir: …/src/pytest, inifile: tox.ini
plugins: xdist-1.31.0, pyannotate-1.2.0, forked-1.1.3
collected 57 items / 56 deselected / 1 selected

testing/test_runner_new.py ===================================== test session starts ======================================
platform linux -- Python 3.8.2, pytest-5.3.5.dev883+g03dca1aeb.d20200326, py-1.8.2.dev5+g043b5868.d20200315, pluggy-0.13.2.dev20+g6e8b6d4.d20200311
rootdir: /tmp/pytest-of-user/pytest-114/test_boxed_suicide0
plugins: xdist-1.31.0, pyannotate-1.2.0, forked-1.1.3
collected 1 item
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "…/Vcs/pytest-forked/src/pytest_forked/__init__.py", line 75, in report_process_crash
INTERNALERROR>     from _pytest.compat import getfslineno
INTERNALERROR> ImportError: cannot import name 'getfslineno' from '_pytest.compat' (…/src/pytest/src/_pytest/compat.py)
INTERNALERROR>
INTERNALERROR> During handling of the above exception, another exception occurred:
INTERNALERROR>
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "…/src/pytest/src/_pytest/main.py", line 191, in wrap_session
INTERNALERROR>     session.exitstatus = doit(config, session) or 0
INTERNALERROR>   File "…/src/pytest/src/_pytest/main.py", line 247, in _main
INTERNALERROR>     config.hook.pytest_runtestloop(session=session)
INTERNALERROR>   File "…/Vcs/pluggy/src/pluggy/hooks.py", line 292, in __call__
INTERNALERROR>     return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR>   File "…/Vcs/pluggy/src/pluggy/manager.py", line 93, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "…/Vcs/pluggy/src/pluggy/manager.py", line 349, in traced_hookexec
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "…/Vcs/pluggy/src/pluggy/callers.py", line 88, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "…/Vcs/pluggy/src/pluggy/callers.py", line 60, in from_call
INTERNALERROR>     result = func()
INTERNALERROR>   File "…/Vcs/pluggy/src/pluggy/manager.py", line 347, in <lambda>
INTERNALERROR>     outcome = _Result.from_call(lambda: oldcall(hook, hook_impls, kwargs))
INTERNALERROR>   File "…/Vcs/pluggy/src/pluggy/manager.py", line 84, in <lambda>
INTERNALERROR>     self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall(
INTERNALERROR>   File "…/Vcs/pluggy/src/pluggy/callers.py", line 216, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "…/Vcs/pluggy/src/pluggy/callers.py", line 88, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "…/Vcs/pluggy/src/pluggy/callers.py", line 195, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "…/src/pytest/src/_pytest/main.py", line 272, in pytest_runtestloop
INTERNALERROR>     item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem)
INTERNALERROR>   File "…/Vcs/pluggy/src/pluggy/hooks.py", line 292, in __call__
INTERNALERROR>     return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR>   File "…/Vcs/pluggy/src/pluggy/manager.py", line 93, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "…/Vcs/pluggy/src/pluggy/manager.py", line 349, in traced_hookexec
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "…/Vcs/pluggy/src/pluggy/callers.py", line 88, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "…/Vcs/pluggy/src/pluggy/callers.py", line 60, in from_call
INTERNALERROR>     result = func()
INTERNALERROR>   File "…/Vcs/pluggy/src/pluggy/manager.py", line 347, in <lambda>
INTERNALERROR>     outcome = _Result.from_call(lambda: oldcall(hook, hook_impls, kwargs))
INTERNALERROR>   File "…/Vcs/pluggy/src/pluggy/manager.py", line 84, in <lambda>
INTERNALERROR>     self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall(
INTERNALERROR>   File "…/Vcs/pluggy/src/pluggy/callers.py", line 216, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "…/Vcs/pluggy/src/pluggy/callers.py", line 88, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "…/Vcs/pluggy/src/pluggy/callers.py", line 195, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "…/Vcs/pytest-forked/src/pytest_forked/__init__.py", line 42, in pytest_runtest_protocol
INTERNALERROR>     reports = forked_run_report(item)
INTERNALERROR>   File "…/Vcs/pytest-forked/src/pytest_forked/__init__.py", line 70, in forked_run_report
INTERNALERROR>     return [report_process_crash(item, result)]
INTERNALERROR>   File "…/Vcs/pytest-forked/src/pytest_forked/__init__.py", line 78, in report_process_crash
INTERNALERROR>     path, lineno = item._getfslineno()
INTERNALERROR> AttributeError: 'Function' object has no attribute '_getfslineno'

==================================== no tests ran in 0.02s =====================================

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> PDB set_trace >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
ENTER /tmp/pytest-of-user/pytest-114/test_boxed_suicide0 => /home/user
--Return--
[32] > …/src/pytest/testing/test_runner_new.py(439)test_boxed_suicide()->None
-> __import__('pdb').set_trace()
   5 frames hidden (try 'help hidden_frames')