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
merged 1 commit into from Sep 3, 2018

Conversation

Projects
None yet
2 participants
@jmbowman
Contributor

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/main.py", 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/__init__.py", 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/__init__.py", 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/__init__.py", 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/callers.py", line 201, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/pluggy/callers.py", line 77, in get_result
INTERNALERROR>     _reraise(*ex)  # noqa
INTERNALERROR>   File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/pluggy/callers.py", 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/plugin.py", 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/plugin.py", line 174, in start
INTERNALERROR>     self.cov_controller.start()
INTERNALERROR>   File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/pytest_cov/engine.py", 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.

@jmbowman

This comment has been minimized.

Contributor

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
Details

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](https://pypi.org/project/pytest-cov) from **2.5.1** to **2.6.0**.



<details>
  <summary>Changelog</summary>
  
  
   ### 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;https://github.com/pytest-dev/pytest-cov/pull/195&gt;`_.
* Fixed ``TypeError: &#39;NoneType&#39; object is not iterable`` in certain xdist configurations. Contributed by Jeremy Bowman in
  `213 &lt;https://github.com/pytest-dev/pytest-cov/pull/213&gt;`_.
* Added a ``no_cover`` marker and fixture. Fixes
  `78 &lt;https://github.com/pytest-dev/pytest-cov/issues/78&gt;`_.
* Fixed broken ``no_cover`` check when running doctests. Contributed by Terence Honles in
  `200 &lt;https://github.com/pytest-dev/pytest-cov/pull/200&gt;`_.
* Fixed various issues with path normalization in reports (when combining coverage data from parallel mode). Fixes
  `130 &lt;https://github.com/pytest-dev/pytest-cov/issues/161&gt;`_.
  Contributed by Ryan Hiebert &amp; Ionel Cristian Mărieș in
  `178 &lt;https://github.com/pytest-dev/pytest-cov/pull/178&gt;`_.
* Report generation failures don&#39;t raise exceptions anymore. A warning will be logged instead. Fixes
  `161 &lt;https://github.com/pytest-dev/pytest-cov/issues/161&gt;`_.
* Fixed multiprocessing issue on Windows (empty env vars are not passed). Fixes
  `165 &lt;https://github.com/pytest-dev/pytest-cov/issues/165&gt;`_.
   ```
   
  
</details>


 

<details>
  <summary>Links</summary>
  
  - PyPI: https://pypi.org/project/pytest-cov
  - Changelog: https://pyup.io/changelogs/pytest-cov/
  - Repo: https://github.com/pytest-dev/pytest-cov
</details>



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