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

Unknown hook with latest pytest #607

Closed
koxu1996 opened this issue Jun 2, 2018 · 3 comments
Closed

Unknown hook with latest pytest #607

koxu1996 opened this issue Jun 2, 2018 · 3 comments

Comments

@koxu1996
Copy link

koxu1996 commented Jun 2, 2018

After upgrading pytest to 3.6.0 I am getting Unknown hook error:

[http@e6efef5e7fb9 app]$ pytest
===================================================================================== test session starts =====================================================================================
platform linux -- Python 3.6.5, pytest-3.6.0, py-1.5.3, pluggy-0.6.0
Django settings: app.test_settings (from ini file)
rootdir: /var/www/html/app, inifile: pytest.ini
plugins: django-3.2.1, cov-2.5.1
collecting 95 items                                                                                                                                                                           INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/usr/lib/python3.6/site-packages/_pytest/main.py", line 107, in wrap_session
INTERNALERROR>     session.exitstatus = doit(config, session) or 0
INTERNALERROR>   File "/usr/lib/python3.6/site-packages/_pytest/main.py", line 144, in _main
INTERNALERROR>     config.hook.pytest_collection(session=session)
INTERNALERROR>   File "/usr/lib/python3.6/site-packages/pluggy/__init__.py", line 617, in __call__
INTERNALERROR>     return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
INTERNALERROR>   File "/usr/lib/python3.6/site-packages/pluggy/__init__.py", line 222, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/usr/lib/python3.6/site-packages/pluggy/__init__.py", line 216, in <lambda>
INTERNALERROR>     firstresult=hook.spec_opts.get('firstresult'),
INTERNALERROR>   File "/usr/lib/python3.6/site-packages/pluggy/callers.py", line 201, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/usr/lib/python3.6/site-packages/pluggy/callers.py", line 76, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/usr/lib/python3.6/site-packages/pluggy/callers.py", line 180, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/usr/lib/python3.6/site-packages/_pytest/main.py", line 154, in pytest_collection
INTERNALERROR>     return session.perform_collect()
INTERNALERROR>   File "/usr/lib/python3.6/site-packages/_pytest/main.py", line 352, in perform_collect
INTERNALERROR>     self.config.pluginmanager.check_pending()
INTERNALERROR>   File "/usr/lib/python3.6/site-packages/pluggy/__init__.py", line 385, in check_pending
INTERNALERROR>     (name, hookimpl.plugin))
INTERNALERROR> pluggy.PluginValidationError: unknown hook 'pytest_django' in plugin <module 'functional_tests.conftest' (<_pytest.assertion.rewrite.AssertionRewritingHook object at 0x7f43563f8668>)>

================================================================================ no tests ran in 1.55 seconds =================================================================================

This is content of conftest.py:

import pytest
import pytest_django.fixtures


@pytest.fixture(scope='module')
def django_db_setup(
    request,
    django_test_environment,
    django_db_blocker,
    django_db_use_migrations,
    django_db_keepdb,
    django_db_createdb,
    django_db_modify_db_settings,
):
    # temporarily no code here
    return pytest_django.fixtures.django_db_setup(
        request,
        django_test_environment,
        django_db_blocker,
        django_db_use_migrations,
        django_db_keepdb,
        django_db_createdb,
        django_db_modify_db_settings,
    )

@peterbe
Copy link

peterbe commented Aug 8, 2018

I ran into a similar error. But upgrading pluggy seems to have solved it. I didn't have time to investigate but I now I have pytest==3.7.1, pytest-django==3.3.3 and pluggy==0.7.1 all working together.

@blueyed
Copy link
Contributor

blueyed commented Feb 3, 2019

Closing as per previous comment.

@thileepand
Copy link

thileepand commented Oct 17, 2019

Use this command

pip uninstall pytest-allure-adaptor
pip install allure-pytest

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

No branches or pull requests

4 participants