Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
blueyed opened this issue Mar 26, 2020 · 0 comments · Fixed by #32
Closed

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

blueyed opened this issue Mar 26, 2020 · 0 comments · Fixed by #32

Comments

@blueyed
Copy link

blueyed commented Mar 26, 2020

_getfslineno has been removed in pytest in pytest-dev/pytest@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')
blueyed added a commit to blueyed/pytest that referenced this issue Mar 26, 2020
Tried to write a test using `--boxed`, but it fails due to
pytest-dev/pytest-forked#30.
blueyed added a commit to blueyed/pytest that referenced this issue Mar 31, 2020
Tried to write a test using `--boxed`, but it fails due to
pytest-dev/pytest-forked#30.
blueyed added a commit to blueyed/pytest that referenced this issue Mar 31, 2020
Tried to write a test using `--boxed`, but it fails due to
pytest-dev/pytest-forked#30.
blueyed added a commit to blueyed/pytest that referenced this issue Apr 3, 2020
Tried to write a test using `--boxed`, but it fails due to
pytest-dev/pytest-forked#30.
blueyed added a commit to blueyed/pytest that referenced this issue Apr 3, 2020
Tried to write a test using `--boxed`, but it fails due to
pytest-dev/pytest-forked#30.
blueyed added a commit to blueyed/pytest that referenced this issue Apr 3, 2020
Tried to write a test using `--boxed`, but it fails due to
pytest-dev/pytest-forked#30.
blueyed added a commit to blueyed/pytest that referenced this issue Apr 5, 2020
Tried to write a test using `--boxed`, but it fails due to
pytest-dev/pytest-forked#30.
blueyed added a commit to blueyed/pytest that referenced this issue Apr 5, 2020
Tried to write a test using `--boxed`, but it fails due to
pytest-dev/pytest-forked#30.
blueyed added a commit to blueyed/pytest that referenced this issue Apr 5, 2020
Tried to write a test using `--boxed`, but it fails due to
pytest-dev/pytest-forked#30.
blueyed added a commit to blueyed/pytest that referenced this issue Apr 5, 2020
Tried to write a test using `--boxed`, but it fails due to
pytest-dev/pytest-forked#30.
blueyed added a commit to pytest-dev/pytest that referenced this issue Apr 7, 2020
stanislavlevin added a commit to stanislavlevin/pytest-forked that referenced this issue May 7, 2020
'getfslineno' has been removed from 'compat' in Pytest [0].
However, that function was just the wrapper of
'_pytest._code.source.getfslineno'. The latter exists in Pytest
since, at least, 3.0.0.

[0]: pytest-dev/pytest@9c7f1d9b3.

Fixes: pytest-dev#30
Signed-off-by: Stanislav Levin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant