Skip to content

Internalerror KeyError: 'nodeid' #1034

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

Closed
logicabrity opened this issue Sep 21, 2015 · 19 comments
Closed

Internalerror KeyError: 'nodeid' #1034

logicabrity opened this issue Sep 21, 2015 · 19 comments
Labels
plugin: xdist related to the xdist external plugin type: backward compatibility might present some backward compatibility issues which should be carefully noted in the changelog type: bug problem that needs to be addressed

Comments

@logicabrity
Copy link

When I try running tests with py.test version 2.8.0 on my Ubuntu 14.04 LTS machine, I get the following internal error:

$ py.test

INTERNALERROR> Traceback (most recent call last):
INTERNALERROR> File "/usr/local/lib/python2.7/dist-packages/_pytest/main.py", line 86, in wrap_session
INTERNALERROR> config._do_configure()
INTERNALERROR> File "/usr/local/lib/python2.7/dist-packages/_pytest/config.py", line 829, in _do_configure
INTERNALERROR> self.hook.pytest_configure.call_historic(kwargs=dict(config=self))
INTERNALERROR> File "/usr/local/lib/python2.7/dist-packages/_pytest/vendored_packages/pluggy.py", line 729, in call_historic
INTERNALERROR> self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
INTERNALERROR> File "/usr/local/lib/python2.7/dist-packages/_pytest/vendored_packages/pluggy.py", line 338, in _hookexec
INTERNALERROR> return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR> File "/usr/local/lib/python2.7/dist-packages/_pytest/vendored_packages/pluggy.py", line 333, in
INTERNALERROR> _MultiCall(methods, kwargs, hook.spec_opts).execute()
INTERNALERROR> File "/usr/local/lib/python2.7/dist-packages/_pytest/vendored_packages/pluggy.py", line 596, in execute
INTERNALERROR> res = hook_impl.function(*args)
INTERNALERROR> File "/usr/local/lib/python2.7/dist-packages/xdist/plugin.py", line 62, in pytest_configure
INTERNALERROR> multicall.execute()
INTERNALERROR> File "/usr/local/lib/python2.7/dist-packages/_pytest/vendored_packages/pluggy.py", line 596, in execute
INTERNALERROR> res = hook_impl.function(*args)
INTERNALERROR> File "/usr/local/lib/python2.7/dist-packages/_pytest/terminal.py", line 47, in pytest_configure
INTERNALERROR> config.pluginmanager.register(reporter, 'terminalreporter')
INTERNALERROR> File "/usr/local/lib/python2.7/dist-packages/_pytest/config.py", line 206, in register
INTERNALERROR> ret = super(PytestPluginManager, self).register(plugin, name)
INTERNALERROR> File "/usr/local/lib/python2.7/dist-packages/_pytest/vendored_packages/pluggy.py", line 370, in register
INTERNALERROR> hook._maybe_apply_history(hookimpl)
INTERNALERROR> File "/usr/local/lib/python2.7/dist-packages/_pytest/vendored_packages/pluggy.py", line 747, in _maybe_apply_history
INTERNALERROR> res = self._hookexec(self, [method], kwargs)
INTERNALERROR> File "/usr/local/lib/python2.7/dist-packages/_pytest/vendored_packages/pluggy.py", line 338, in _hookexec
INTERNALERROR> return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR> File "/usr/local/lib/python2.7/dist-packages/_pytest/vendored_packages/pluggy.py", line 333, in
INTERNALERROR> _MultiCall(methods, kwargs, hook.spec_opts).execute()
INTERNALERROR> File "/usr/local/lib/python2.7/dist-packages/_pytest/vendored_packages/pluggy.py", line 593, in execute
INTERNALERROR> args = [all_kwargs[argname] for argname in hook_impl.argnames]
INTERNALERROR> KeyError: 'nodeid'

$ py.test --version

This is pytest version 2.8.0, imported from /usr/local/lib/python2.7/dist-packages/pytest.pyc
setuptools registered plugins:
pytest-xdist-1.11 at /usr/local/lib/python2.7/dist-packages/xdist/plugin.pyc

What's wrong?

@RonnyPfannschmidt RonnyPfannschmidt added type: bug problem that needs to be addressed plugin: xdist related to the xdist external plugin type: backward compatibility might present some backward compatibility issues which should be carefully noted in the changelog labels Sep 21, 2015
@RonnyPfannschmidt
Copy link
Member

at first glance it seems like a hook is expecting an argument that is not given at hook invocation

@hpk42 @flub - please take a deeper look

@logicabrity
Copy link
Author

@flub assisted on IRC and I removed and reinstalled pytest-xdist using pip and that solved the issue.

$ py.test --version
This is pytest version 2.8.0, imported from /usr/local/lib/python2.7/dist-packages/pytest.pyc
setuptools registered plugins:
pytest-xdist-1.13.1 at /usr/local/lib/python2.7/dist-packages/xdist/boxed.pyc
pytest-xdist-1.13.1 at /usr/local/lib/python2.7/dist-packages/xdist/looponfail.pyc
pytest-xdist-1.13.1 at /usr/local/lib/python2.7/dist-packages/xdist/plugin.pyc

Should I delete this issue?

@nicoddemus
Copy link
Member

If you don't have any more questions, please do. 😄

@RonnyPfannschmidt
Copy link
Member

we should still report a bug to pluggy, since the error messages it gives are subpar atm

@nicoddemus
Copy link
Member

Thanks Ronny!

@jerel
Copy link

jerel commented Sep 21, 2015

My project just started throwing this error today on TravisCI. Pinning to pytest 2.7.2 solves the issue for now.

@nicoddemus
Copy link
Member

Can you share the project? Or at least which plugins it uses? This still has to be studied better, but it seems to be a hook calling another without all required arguments.

@jerel
Copy link

jerel commented Sep 21, 2015

@nicoddemus
Copy link
Member

Thanks!

@nicoddemus
Copy link
Member

I'm reopening this... I think there's a deeper problem here, because @jerel's project uses pure pytest. Looking at the traceback, perhaps it has something to do with pytest_cache and the fact that it is a historic hook being called?

@RonnyPfannschmidt what do you think?

@nicoddemus nicoddemus reopened this Sep 21, 2015
@habnabit
Copy link

👍 having this issue internally too. I can't share logs, but I can try to make a test-case if it's not obvious from the above error. The build fails with this requirements.txt:

pytest
pytest-django
pytest-factoryboy
pytest-cov

and passes with this:

pytest != 2.8.0
pytest-django
pytest-factoryboy
pytest-cov

@RonnyPfannschmidt
Copy link
Member

@habnabit can you share the exact versions of the libraries as well?

@bh
Copy link
Member

bh commented Sep 22, 2015

Same behavior with the following versions:

$ pip freeze | grep pytest                                                                                                                                           
pytest==2.8.0
pytest-bdd==2.15.0
pytest-cov==2.1.0
pytest-django==2.8.0
-e git+https://github.com/mverteuil/pytest-ipdb.git@2b9a5a43a19d22bd16035f5fcfe9d657dc4acba3#egg=pytest_ipdb-dev
pytest-rerunfailures==0.5
pytest-splinter==1.7.0
pytest-xdist==1.13.1
$ py.test
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/home/bhe/.virtualenvs/mx/lib/python3.4/site-packages/_pytest/main.py", line 86, in wrap_session
INTERNALERROR>     config._do_configure()
INTERNALERROR>   File "/home/bhe/.virtualenvs/mx/lib/python3.4/site-packages/_pytest/config.py", line 829, in _do_configure
INTERNALERROR>     self.hook.pytest_configure.call_historic(kwargs=dict(config=self))
INTERNALERROR>   File "/home/bhe/.virtualenvs/mx/lib/python3.4/site-packages/_pytest/vendored_packages/pluggy.py", line 729, in call_historic
INTERNALERROR>     self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
INTERNALERROR>   File "/home/bhe/.virtualenvs/mx/lib/python3.4/site-packages/_pytest/vendored_packages/pluggy.py", line 338, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/home/bhe/.virtualenvs/mx/lib/python3.4/site-packages/_pytest/vendored_packages/pluggy.py", line 333, in <lambda>
INTERNALERROR>     _MultiCall(methods, kwargs, hook.spec_opts).execute()
INTERNALERROR>   File "/home/bhe/.virtualenvs/mx/lib/python3.4/site-packages/_pytest/vendored_packages/pluggy.py", line 596, in execute
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/home/bhe/.virtualenvs/mx/lib/python3.4/site-packages/_pytest/terminal.py", line 47, in pytest_configure
INTERNALERROR>     config.pluginmanager.register(reporter, 'terminalreporter')
INTERNALERROR>   File "/home/bhe/.virtualenvs/mx/lib/python3.4/site-packages/_pytest/config.py", line 206, in register
INTERNALERROR>     ret = super(PytestPluginManager, self).register(plugin, name)
INTERNALERROR>   File "/home/bhe/.virtualenvs/mx/lib/python3.4/site-packages/_pytest/vendored_packages/pluggy.py", line 370, in register
INTERNALERROR>     hook._maybe_apply_history(hookimpl)
INTERNALERROR>   File "/home/bhe/.virtualenvs/mx/lib/python3.4/site-packages/_pytest/vendored_packages/pluggy.py", line 747, in _maybe_apply_history
INTERNALERROR>     res = self._hookexec(self, [method], kwargs)
INTERNALERROR>   File "/home/bhe/.virtualenvs/mx/lib/python3.4/site-packages/_pytest/vendored_packages/pluggy.py", line 338, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/home/bhe/.virtualenvs/mx/lib/python3.4/site-packages/_pytest/vendored_packages/pluggy.py", line 333, in <lambda>
INTERNALERROR>     _MultiCall(methods, kwargs, hook.spec_opts).execute()
INTERNALERROR>   File "/home/bhe/.virtualenvs/mx/lib/python3.4/site-packages/_pytest/vendored_packages/pluggy.py", line 593, in execute
INTERNALERROR>     args = [all_kwargs[argname] for argname in hook_impl.argnames]
INTERNALERROR>   File "/home/bhe/.virtualenvs/mx/lib/python3.4/site-packages/_pytest/vendored_packages/pluggy.py", line 593, in <listcomp>
INTERNALERROR>     args = [all_kwargs[argname] for argname in hook_impl.argnames]
INTERNALERROR> KeyError: 'nodeid'

@habnabit
Copy link

@RonnyPfannschmidt
no error:

pytest==2.7.2
pytest-cov==2.0.0
pytest-django==2.8.0
pytest-factoryboy==1.1.2

error:

pytest==2.8.0
pytest-cov==2.1.0
pytest-django==2.8.0
pytest-factoryboy==1.1.3

@drcongo
Copy link

drcongo commented Sep 23, 2015

Also just run into this, was running fine until I added pytest-factoryboy. Downgrading to 2.7.2 "fixes" it for me.

working:

pytest==2.7.2
pytest-factoryboy==1.1.4
pytest-flask==0.10.0

@RonnyPfannschmidt
Copy link
Member

recent pluggy made a better exception handler

for anyone testing this, can you install pluggy from git and remove the vendored one in the pytest install

@vodik
Copy link
Contributor

vodik commented Sep 28, 2015

Assuming the commit above does the trick, pytest is bailing trying to print the following warning message when using addhooks:

use pluginmanager.add_hookspecs instead of deprecated addhooks() method.

@vodik
Copy link
Contributor

vodik commented Sep 29, 2015

Looks like addhooks may indeed be the problem in pytest-factoryboy.

@drcongo
Copy link

drcongo commented Sep 30, 2015

Thanks @vodik and @hpk42

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugin: xdist related to the xdist external plugin type: backward compatibility might present some backward compatibility issues which should be carefully noted in the changelog type: bug problem that needs to be addressed
Projects
None yet
Development

No branches or pull requests

8 participants