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

Pytest cannot load its plugin 'pytest_cov' with latest package level #1371

Closed
andy-maier opened this issue Sep 5, 2018 · 4 comments

Comments

Projects
None yet
2 participants
@andy-maier
Copy link
Contributor

commented Sep 5, 2018

make test fails because pytest cannot load its plugin 'pytest_cov'.

The following traceback is from Travis run: https://travis-ci.org/pywbem/pywbem/jobs/424857470

bash -c "set -o pipefail; PYTHONWARNINGS=default py.test --color=yes --cov pywbem --cov pywbem_mock  --cov-config coveragerc  --ignore=attic --ignore=releases -s 2>&1 |tee test_27.tmp.log"
/opt/python/2.7.14/lib/python2.7/pkgutil.py:186: ImportWarning: Not importing directory '/home/travis/virtualenv/python2.7.14/lib/python2.7/site-packages/sphinxcontrib': missing __init__.py
  file, filename, etc = imp.find_module(subname, path)
Traceback (most recent call last):
  File "/home/travis/virtualenv/python2.7.14/bin/py.test", line 11, in <module>
    sys.exit(main())
  File "/home/travis/virtualenv/python2.7.14/lib/python2.7/site-packages/_pytest/config/__init__.py", line 56, in main
    config = _prepareconfig(args, plugins)
  File "/home/travis/virtualenv/python2.7.14/lib/python2.7/site-packages/_pytest/config/__init__.py", line 181, in _prepareconfig
    pluginmanager=pluginmanager, args=args
  File "/home/travis/virtualenv/python2.7.14/lib/python2.7/site-packages/pluggy/hooks.py", line 258, in __call__
    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
  File "/home/travis/virtualenv/python2.7.14/lib/python2.7/site-packages/pluggy/manager.py", line 67, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/home/travis/virtualenv/python2.7.14/lib/python2.7/site-packages/pluggy/manager.py", line 61, in <lambda>
    firstresult=hook.spec_opts.get('firstresult'),
  File "/home/travis/virtualenv/python2.7.14/lib/python2.7/site-packages/pluggy/callers.py", line 196, in _multicall
    gen.send(outcome)
  File "/home/travis/virtualenv/python2.7.14/lib/python2.7/site-packages/_pytest/helpconfig.py", line 89, in pytest_cmdline_parse
    config = outcome.get_result()
  File "/home/travis/virtualenv/python2.7.14/lib/python2.7/site-packages/pluggy/callers.py", line 77, in get_result
    _reraise(*ex)  # noqa
  File "/home/travis/virtualenv/python2.7.14/lib/python2.7/site-packages/pluggy/callers.py", line 180, in _multicall
    res = hook_impl.function(*args)
  File "/home/travis/virtualenv/python2.7.14/lib/python2.7/site-packages/_pytest/config/__init__.py", line 617, in pytest_cmdline_parse
    self.parse(args)
  File "/home/travis/virtualenv/python2.7.14/lib/python2.7/site-packages/_pytest/config/__init__.py", line 782, in parse
    self._preparse(args, addopts=addopts)
  File "/home/travis/virtualenv/python2.7.14/lib/python2.7/site-packages/_pytest/config/__init__.py", line 734, in _preparse
    self.pluginmanager.load_setuptools_entrypoints("pytest11")
  File "/home/travis/virtualenv/python2.7.14/lib/python2.7/site-packages/pluggy/manager.py", line 259, in load_setuptools_entrypoints
    message="Plugin %r could not be loaded: %s!" % (ep.name, e))
pluggy.manager.PluginValidationError: Plugin 'pytest_cov' could not be loaded: (coverage 4.0.3 (/home/travis/virtualenv/python2.7.14/lib/python2.7/site-packages), Requirement.parse('coverage>=4.4'))!
make: *** [test] Error 1

@andy-maier andy-maier self-assigned this Sep 5, 2018

@andy-maier

This comment has been minimized.

Copy link
Contributor Author

commented Sep 5, 2018

Analysis shows that this is related to the issue around requiring different versions of the coverage package:

pytest-cov 2.6.0 has increased the version requirement for the coverage package from >=3.7.1 to >=4.4, which is in conflict with the version requirement defined by the python-coveralls package for coverage==4.0.3.

Issue z4r/python-coveralls#66 has been opened.

Workaround is to pin the pytest_cov version to below 2.6.0.

@andy-maier

This comment has been minimized.

Copy link
Contributor Author

commented Sep 5, 2018

PR #1370 implements the workaround to pin the pytest_cov version to below 2.6.0.

@jkMugabe

This comment has been minimized.

Copy link

commented Jan 18, 2019

python-coveralls 2.9.1 has requirement coverage==4.0.3, but you'll have coverage 4.5.2 which is incompatible

@jkMugabe

This comment has been minimized.

Copy link

commented Jan 18, 2019

i need the solution please

fhieber added a commit to awslabs/sockeye that referenced this issue Jan 21, 2019

@fhieber fhieber referenced this issue Jan 21, 2019

Merged

fix pytest-cov to 2.6.0 for Travis #624

4 of 4 tasks complete

langmm added a commit to cropsinsilico/yggdrasil that referenced this issue Feb 7, 2019

langmm added a commit to cropsinsilico/yggdrasil that referenced this issue Feb 7, 2019

wtgee added a commit to wtgee/panoptes-utils that referenced this issue Apr 11, 2019

derwentx added a commit to derwentx/wp-api-python that referenced this issue May 5, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.