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

Allow remote nodes to get source modules from .coveragerc #213

merged 1 commit into from Sep 3, 2018


None yet
2 participants

jmbowman commented Jul 24, 2018

Although you can normally use --cov without an argument to read the modules to be covered from .coveragerc, this currently doesn't work for non-collocated xdist workers because the code doesn't account for the possibility that self.cov_source is None:

INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "_pytest/", line 176, in wrap_session
INTERNALERROR>     config.hook.pytest_sessionstart(session=session)
INTERNALERROR>   File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/pluggy/", line 617, in __call__
INTERNALERROR>     return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
INTERNALERROR>   File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/pluggy/", line 222, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/pluggy/", line 216, in <lambda>
INTERNALERROR>     firstresult=hook.spec_opts.get('firstresult'),
INTERNALERROR>   File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/pluggy/", line 201, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/pluggy/", line 77, in get_result
INTERNALERROR>     _reraise(*ex)  # noqa
INTERNALERROR>   File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/pluggy/", line 180, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/pytest_cov/", line 195, in pytest_sessionstart
INTERNALERROR>     self.start(engine.DistSlave, session.config, nodeid)
INTERNALERROR>   File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/pytest_cov/", line 174, in start
INTERNALERROR>     self.cov_controller.start()
INTERNALERROR>   File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/pytest_cov/", line 250, in start
INTERNALERROR>     for source in self.cov_source]
INTERNALERROR> TypeError: 'NoneType' object is not iterable

This change just accounts for that possibility and tests that it loads the modules to be covered from the configuration file in this case.


This comment has been minimized.


jmbowman commented Jul 25, 2018

All the test failures were due to the race condition which should be fixed by #214 . I can rebase once that's merged to get a clean build here.

@ionelmc ionelmc merged commit 2cf01fd into pytest-dev:master Sep 3, 2018

1 check failed

continuous-integration/travis-ci/pr The Travis CI build failed

bors bot added a commit to rehandalal/therapist that referenced this pull request Sep 6, 2018

Merge #31
31: Update pytest-cov to 2.6.0 r=rehandalal a=pyup-bot

This PR updates [pytest-cov]( from **2.5.1** to **2.6.0**.

   ### 2.6.0

* Dropped support for Python &lt; 3.4, Pytest &lt; 3.5 and Coverage &lt; 4.4.
* Fixed some documentation formatting. Contributed by Jean Jordaan and Julian.
* Added an example with ``addopts`` in documentation. Contributed by Samuel Giffard in
  `195 &lt;;`_.
* Fixed ``TypeError: &#39;NoneType&#39; object is not iterable`` in certain xdist configurations. Contributed by Jeremy Bowman in
  `213 &lt;;`_.
* Added a ``no_cover`` marker and fixture. Fixes
  `78 &lt;;`_.
* Fixed broken ``no_cover`` check when running doctests. Contributed by Terence Honles in
  `200 &lt;;`_.
* Fixed various issues with path normalization in reports (when combining coverage data from parallel mode). Fixes
  `130 &lt;;`_.
  Contributed by Ryan Hiebert &amp; Ionel Cristian Mărieș in
  `178 &lt;;`_.
* Report generation failures don&#39;t raise exceptions anymore. A warning will be logged instead. Fixes
  `161 &lt;;`_.
* Fixed multiprocessing issue on Windows (empty env vars are not passed). Fixes
  `165 &lt;;`_.


  - PyPI:
  - Changelog:
  - Repo:

Co-authored-by: pyup-bot <>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment