pytest: 3.7.0: Hookspec method signature regression

When upgrading from pytest 3.6.x to 3.7, it seems as though the signature for hookspec has changed:

Traceback (most recent call last):
  File "<redacted>/python3.6/site-packages/_pytest/hookspec.py", line 27, in <module>
    @hookspec(historic=True, warn_on_impl=PYTEST_NAMESPACE)
TypeError: __call__() got an unexpected keyword argument 'warn_on_impl'
ERROR: InvocationError for command '<redacted>/bin/pytest -x --pdb' (exited with code 1)

Reverting back to 3.6.4 fixes the issue.

Plugins being used:

    pytest-mock
    pytest-asyncio
    pytest_profiling

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 25 (16 by maintainers)

Commits related to this issue

Most upvoted comments

The problem seems to be that tox has this requirement: pluggy<1,>=0.3.0 and pip gets confused. I’ve solved it by adding “pluggy>=0.7” to my own requirements file.

It might be pip dependency resolver playing tricks then, because pytest 3.7 does require pluggy>=0.7:

https://github.com/pytest-dev/pytest/blob/253419316ce09b952862811db229a9e9383a332b/setup.py#L72

I suggest to try recreating the environment with -r to see if the problem goes away.

@RonnyPfannschmidt

  • after some RTFM
  • watching Kenneth Reitz - Pipenv: The Future of Python Dependency Management - PyCon 2018
  • I have decided to hack around with pipenv
    • no more pip plus virtualenvs all in one box;)

many thanks

@RonnyPfannschmidt ok, I trust this is what you were looking for 😉

My Hiccup

It’s possible that a system level install is shadowing the newer version ? YES

I am new to Python but not to nix, so decided I would use 3.6.

As all apps are easy to install, I only need ONE copy even thought I do have numerous user accounts.

  • sudo -H pip3 install --upgrade --force-reinstall pytest-cov
    • pytest-cov==2.5.1
    • pytest==3.7.4
    • pluggy==0.7.1

Should have been all that I needed, But

  • pip[3] list |grep pluggy OR pip[3] list |grep pytest

    • I assumed that pip is using the same search rules as python, thus we see some pluggy==0.6.0 lying around from disrto install or deb.
    • showed remnants of the following
      • pytest==3.6.4
      • pluggy==0.6.0
  • Looked for pytest & pluggy in /usr/local/lib/python[x.x]/dist-packages/

    • rm -rf to _ files dirs of pluggy & pytest

CLEAN

  • sudo -H pip3 install --upgrade --force-reinstall pytest-cov

All Good