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

TypeError: sequence index must be integer, not 'str' #144

Closed
tetianakh opened this Issue Jan 5, 2017 · 6 comments

Comments

Projects
None yet
3 participants
@tetianakh

tetianakh commented Jan 5, 2017

Hello,

I get this error when one of the tests fails:

Error processing line 1 of /path/to/lib/python2.7/site-packages/pytest-cov.pth:
  Traceback (most recent call last):
    File "/path/to/lib/python2.7/site.py", line 152, in addpackage
      exec line
    File "<string>", line 1, in <module>
    File "<string>", line 10, in <module>
  TypeError: sequence index must be integer, not 'str'
Remainder of file ignored

Without coverage, I just get a normal pytest output with traceback for the exception that was raised in the failing test.

This happens in Travis CI builds, so in case you want to have a look, here's the link: https://travis-ci.org/tetianakh/bcbio-nextgen/builds/189138489
Output from the same test without coverage: https://travis-ci.org/tetianakh/bcbio-nextgen/builds/189126412

Any ideas what this might be about?

ionelmc added a commit that referenced this issue Jan 5, 2017

@ionelmc

This comment has been minimized.

Member

ionelmc commented Jan 6, 2017

So I've tried to install a branch of pytest-cov (see https://travis-ci.org/ionelmc/bcbio-nextgen#L542) but it don't seem to be running the new code. Any help here?

@ionelmc

This comment has been minimized.

Member

ionelmc commented Jan 6, 2017

Also, the error is about failure to setup coverage for subprocess (a feature of pytest-cov, and the main selling point). If it happens it means something weird is going on in the process (usually pytest_cov or coverage could not be imported).

ionelmc added a commit that referenced this issue Mar 14, 2017

@shaunduncan

This comment has been minimized.

shaunduncan commented May 9, 2017

Hi, I was having a similar issue and stumbled across this report. I have noticed that the pth fix here addresses the issue, at least for me: 8d22dcc#diff-89a1ea490ef6f4c6c356c2ba7fc5f0df

Currently I have a workaround that's not exactly pretty, but it gets the job done. So I guess I was curious: are there any upcoming plans for a new release to be submitted to PyPI that includes the above mentioned commit?

Thanks!

@ionelmc

This comment has been minimized.

Member

ionelmc commented May 9, 2017

Ooops. I forgot to make release. I'm preparing one today.

@shaunduncan

This comment has been minimized.

shaunduncan commented May 9, 2017

Wonderful! Thank you so much, I'll keep an eye out for it!

@ionelmc

This comment has been minimized.

Member

ionelmc commented May 9, 2017

Published 2.5.0.

@ionelmc ionelmc closed this May 9, 2017

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