Skip to content

PluginValidationError: unknown hook 'pytest_configure_node' #246

@PeterJCLaw

Description

@PeterJCLaw

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions