Skip to content

Unknown hook with latest pytest #607

@koxu1996

Description

@koxu1996

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,
    )

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