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

PluginValidationError: unknown hook 'pytest_configure_node' #246

Closed
PeterJCLaw opened this issue Apr 15, 2020 · 2 comments · Fixed by #248
Closed

PluginValidationError: unknown hook 'pytest_configure_node' #246

PeterJCLaw opened this issue Apr 15, 2020 · 2 comments · Fixed by #248

Comments

@PeterJCLaw
Copy link

I've just updated to the latest version of pytest-randomly (3.3) and found that it doesn't work for me.

Steps:

  1. Create a Python 3.6 or 3.7 virtualenv (other Python versions untested)
  2. pip install pytest pytest-randomly==3.3
  3. pytest

This yields the following error output:

$ pytest
======================= test session starts =======================
platform linux -- Python 3.6.10, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
Using --randomly-seed=1586964821
rootdir: /tmp/temp
plugins: randomly-3.3.0
collected 0 items                                                                                                                                                                                               
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File ".../.virtualenvs/temp/lib/python3.6/site-packages/_pytest/main.py", line 191, in wrap_session
INTERNALERROR>     session.exitstatus = doit(config, session) or 0
INTERNALERROR>   File ".../.virtualenvs/temp/lib/python3.6/site-packages/_pytest/main.py", line 246, in _main
INTERNALERROR>     config.hook.pytest_collection(session=session)
INTERNALERROR>   File ".../.virtualenvs/temp/lib/python3.6/site-packages/pluggy/hooks.py", line 286, in __call__
INTERNALERROR>     return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR>   File ".../.virtualenvs/temp/lib/python3.6/site-packages/pluggy/manager.py", line 93, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File ".../.virtualenvs/temp/lib/python3.6/site-packages/pluggy/manager.py", line 87, in <lambda>
INTERNALERROR>     firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
INTERNALERROR>   File ".../.virtualenvs/temp/lib/python3.6/site-packages/pluggy/callers.py", line 208, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File ".../.virtualenvs/temp/lib/python3.6/site-packages/pluggy/callers.py", line 80, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File ".../.virtualenvs/temp/lib/python3.6/site-packages/pluggy/callers.py", line 187, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File ".../.virtualenvs/temp/lib/python3.6/site-packages/_pytest/main.py", line 257, in pytest_collection
INTERNALERROR>     return session.perform_collect()
INTERNALERROR>   File ".../.virtualenvs/temp/lib/python3.6/site-packages/_pytest/main.py", line 453, in perform_collect
INTERNALERROR>     self.config.pluginmanager.check_pending()
INTERNALERROR>   File ".../.virtualenvs/temp/lib/python3.6/site-packages/pluggy/manager.py", line 277, in check_pending
INTERNALERROR>     % (name, hookimpl.plugin),
INTERNALERROR> pluggy.manager.PluginValidationError: unknown hook 'pytest_configure_node' in plugin <module 'pytest_randomly' from '.../.virtualenvs/temp/lib/python3.6/site-packages/pytest_randomly.py'>

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

If I downgrade to pytest-randomly<3.3 then my tests are run as expected.

I'm currently using pytest 5.4.1, though this also reproduces with pytest 5.3.5.

@adamchainz
Copy link
Member

Fixed in #248, released in 3.3.1.

@PeterJCLaw
Copy link
Author

Thanks for fixing so quickly, amazing! :)

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.

2 participants