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-cov 2.5 doesn't seem to work with xdist #157

Closed
tgs opened this Issue May 10, 2017 · 4 comments

Comments

Projects
None yet
2 participants
@tgs

tgs commented May 10, 2017

It seems to cause an endless loop of restarting the workers, which immediately fail each time.

Steps to reproduce:

virtualenv -p python3.4 env
source env/bin/activate
pip install pytest pytest-cov==2.5 pytest-xdist
cat > test_things.py <<END
def test_a():
    assert '1' == '1'

def test_b():
    assert '2' == '2'
END
py.test test_things.py  --dist=load --tx="2*popen//python=`which python`" -v --cov --cov-report=term

This succeeds with pytest-cov 2.4, but fails with 2.5. The backtrace is something like this:

=================================== test session starts ===================================
platform linux -- Python 3.4.5, pytest-3.0.7, py-1.4.33, pluggy-0.4.0 -- /home/smithtg/.virtualenvs/ptc/bin/python3.4
cachedir: .cache
rootdir: /home/smithtg/.virtualenvs/ptc, inifile:
plugins: xdist-1.16.0, cov-2.5.0
[gw0] linux Python 3.4.5 cwd: /home/smithtg/.virtualenvs/ptc
[gw1] linux Python 3.4.5 cwd: /home/smithtg/.virtualenvs/ptc
gw0 C / gw1 CTraceback (most recent call last):
  File "<string>", line 1, in <module>
  File "<string>", line 1539, in <module>
  File "<string>", line 1534, in serve
  File "<string>", line 1047, in serve
  File "<string>", line 259, in integrate_as_primary_thread
  File "<string>", line 277, in _perform_spawn
  File "<string>", line 219, in run
  File "/home/smithtg/.virtualenvs/ptc/lib/python3.4/site-packages/coverage/control.py", line 585, in _should_trace
  File "/home/smithtg/.virtualenvs/ptc/lib/python3.4/site-packages/coverage/control.py", line 530, in _should_trace_internal
  File "/home/smithtg/.virtualenvs/ptc/lib/python3.4/site-packages/coverage/control.py", line 551, in _check_include_omit_etc_internal
  File "/home/smithtg/.virtualenvs/ptc/lib/python3.4/site-packages/coverage/files.py", line 242, in match
TypeError: startswith first arg must be str or a tuple of str, not bool
Exception ignored in: Error in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "/home/smithtg/.virtualenvs/ptc/lib/python3.4/site-packages/coverage/control.py", line 585, in _should_trace
  File "/home/smithtg/.virtualenvs/ptc/lib/python3.4/site-packages/coverage/control.py", line 530, in _should_trace_internal
  File "/home/smithtg/.virtualenvs/ptc/lib/python3.4/site-packages/coverage/control.py", line 551, in _check_include_omit_etc_internal
  File "/home/smithtg/.virtualenvs/ptc/lib/python3.4/site-packages/coverage/files.py", line 242, in match
TypeError: startswith first arg must be str or a tuple of str, not bool
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "/home/smithtg/.virtualenvs/ptc/lib/python3.4/site-packages/coverage/control.py", line 585, in _should_trace
  File "/home/smithtg/.virtualenvs/ptc/lib/python3.4/site-packages/coverage/control.py", line 530, in _should_trace_internal
  File "/home/smithtg/.virtualenvs/ptc/lib/python3.4/site-packages/coverage/control.py", line 551, in _check_include_omit_etc_internal
  File "/home/smithtg/.virtualenvs/ptc/lib/python3.4/site-packages/coverage/files.py", line 242, in match
TypeError: startswith first arg must be str or a tuple of str, not bool
[gw0] node down: Not properly terminated
Replacing crashed slave gw0
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "<string>", line 1539, in <module>
  File "<string>", line 1534, in serve
  File "<string>", line 1047, in serve
  File "<string>", line 259, in integrate_as_primary_thread
[gw2] linux Python 3.4.5 cwd: /home/smithtg/.virtualenvs/ptc
gw2 C / gw1 C  File "<string>", line 277, in _perform_spawn
  File "<string>", line 219, in run
  File "/home/smithtg/.virtualenvs/ptc/lib/python3.4/site-packages/coverage/control.py", line 585, in _should_trace
  File "/home/smithtg/.virtualenvs/ptc/lib/python3.4/site-packages/coverage/control.py", line 530, in _should_trace_internal
  File "/home/smithtg/.virtualenvs/ptc/lib/python3.4/site-packages/coverage/control.py", line 551, in _check_include_omit_etc_internal
  File "/home/smithtg/.virtualenvs/ptc/lib/python3.4/site-packages/coverage/files.py", line 242, in match
TypeError: startswith first arg must be str or a tuple of str, not bool
Exception ignored in: Error in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "/home/smithtg/.virtualenvs/ptc/lib/python3.4/site-packages/coverage/control.py", line 585, in _should_trace
  File "/home/smithtg/.virtualenvs/ptc/lib/python3.4/site-packages/coverage/control.py", line 530, in _should_trace_internal
  File "/home/smithtg/.virtualenvs/ptc/lib/python3.4/site-packages/coverage/control.py", line 551, in _check_include_omit_etc_internal
  File "/home/smithtg/.virtualenvs/ptc/lib/python3.4/site-packages/coverage/files.py", line 242, in match
TypeError: startswith first arg must be str or a tuple of str, not bool
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "/home/smithtg/.virtualenvs/ptc/lib/python3.4/site-packages/coverage/control.py", line 585, in _should_trace
  File "/home/smithtg/.virtualenvs/ptc/lib/python3.4/site-packages/coverage/control.py", line 530, in _should_trace_internal
  File "/home/smithtg/.virtualenvs/ptc/lib/python3.4/site-packages/coverage/control.py", line 551, in _check_include_omit_etc_internal
  File "/home/smithtg/.virtualenvs/ptc/lib/python3.4/site-packages/coverage/files.py", line 242, in match
TypeError: startswith first arg must be str or a tuple of str, not bool
[gw1] node down: Not properly terminated
Replacing crashed slave gw1
[gw3] linux Python 3.4.5 cwd: /home/smithtg/.virtualenvs/ptc
gw2 C / gw3 CTraceback (most recent call last):
  File "<string>", line 1, in <module>
  File "<string>", line 1539, in <module>
  File "<string>", line 1534, in serve
  File "<string>", line 1047, in serve
  File "<string>", line 259, in integrate_as_primary_thread
  File "<string>", line 277, in _perform_spawn
  File "<string>", line 219, in run
  File "/home/smithtg/.virtualenvs/ptc/lib/python3.4/site-packages/coverage/control.py", line 585, in _should_trace
  File "/home/smithtg/.virtualenvs/ptc/lib/python3.4/site-packages/coverage/control.py", line 530, in _should_trace_internal
  File "/home/smithtg/.virtualenvs/ptc/lib/python3.4/site-packages/coverage/control.py", line 551, in _check_include_omit_etc_internal
  File "/home/smithtg/.virtualenvs/ptc/lib/python3.4/site-packages/coverage/files.py", line 242, in match
TypeError: startswith first arg must be str or a tuple of str, not bool
Exception ignored in: Error in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "/home/smithtg/.virtualenvs/ptc/lib/python3.4/site-packages/coverage/control.py", line 585, in _should_trace
  File "/home/smithtg/.virtualenvs/ptc/lib/python3.4/site-packages/coverage/control.py", line 530, in _should_trace_internal
  File "/home/smithtg/.virtualenvs/ptc/lib/python3.4/site-packages/coverage/control.py", line 551, in _check_include_omit_etc_internal
  File "/home/smithtg/.virtualenvs/ptc/lib/python3.4/site-packages/coverage/files.py", line 242, in match
TypeError: startswith first arg must be str or a tuple of str, not bool
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "/home/smithtg/.virtualenvs/ptc/lib/python3.4/site-packages/coverage/control.py", line 585, in _should_trace
  File "/home/smithtg/.virtualenvs/ptc/lib/python3.4/site-packages/coverage/control.py", line 530, in _should_trace_internal
  File "/home/smithtg/.virtualenvs/ptc/lib/python3.4/site-packages/coverage/control.py", line 551, in _check_include_omit_etc_internal
  File "/home/smithtg/.virtualenvs/ptc/lib/python3.4/site-packages/coverage/files.py", line 242, in match
TypeError: startswith first arg must be str or a tuple of str, not bool
[gw2] node down: Not properly terminated
@tgs

This comment has been minimized.

tgs commented May 10, 2017

Another detail -

py.test test_things.py --dist=load --tx="2*popen//python=which python" -v --cov --cov-report=term - doesn't work

py.test test_things.py --dist=load --tx="2*popen//python=which python" -v --cov - works, and prints the terminal report.

So maybe it's an argument processing problem?

ionelmc added a commit that referenced this issue May 10, 2017

Make config processing as late as posssible. Remove some duplicated c…
…onfig processing code.

Interestingly enough, it turns out that the plugin was registred two times! Useless hook removed.

This should fix #157.
@ionelmc

This comment has been minimized.

Member

ionelmc commented May 10, 2017

Yep, something really bad going on there.

I'm working on a fix in #158.

ionelmc added a commit that referenced this issue May 11, 2017

Make config processing as late as posssible. Remove some duplicated c…
…onfig processing code.

Interestingly enough, it turns out that the plugin was registred two times! Useless hook removed.

This should fix #157.

@ionelmc ionelmc closed this in e92c014 May 11, 2017

@ionelmc

This comment has been minimized.

Member

ionelmc commented May 11, 2017

Released 2.5.1.

@tgs

This comment has been minimized.

tgs commented May 12, 2017

Thanks for the quick fix!

jsonn pushed a commit to jsonn/pkgsrc that referenced this issue May 17, 2017

wiz
Updated py-test-cov to 2.5.1.
2.5.1 (2017-05-11)
------------------

* Fixed xdist breakage (regression in ``2.5.0``).
  Fixes `#157 <https://github.com/pytest-dev/pytest-cov/issues/157>`_.
* Allow setting custom ``data_file`` name in ``.coveragerc``.
  Fixes `#145 <https://github.com/pytest-dev/pytest-cov/issues/145>`_.
  Contributed by Jannis Leidel & Ionel Cristian Mărieș in
  `#156 <https://github.com/pytest-dev/pytest-cov/pull/156>`_.

2.5.0 (2017-05-09)
------------------

* Always show a summary when ``--cov-fail-under`` is used. Contributed by Francis Niu in `PR#141
  <https://github.com/pytest-dev/pytest-cov/pull/141>`_.
* Added ``--cov-branch`` option. Fixes `#85 <https://github.com/pytest-dev/pytest-cov/issues/85>`_.
* Improve exception handling in subprocess setup. Fixes `#144 <https://github.com/pytest-dev/pytest-cov/issues/144>`_.
* Fixed handling when ``--cov`` is used multiple times. Fixes `#151 <https://github.com/pytest-dev/pytest-cov/issues/151>`_.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment