-
-
Notifications
You must be signed in to change notification settings - Fork 433
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
IndexError: list index out of range on coverage lcov #1553
Comments
Hello, did you solve this problem? I see the same error |
Can you provide me with a way to reproduce the error? |
Unfortunately I'm not able to isolate the problem to provide a test case and our repository is private. |
I noticed that the error appears in repositories where there are several components, they all have a build and test stage. The way I see the error is this: The command to test and create a coverage is simple: `#!/bin/bash if [ -z ${CI_PROJECT_DIR-} ] ; then pip install --quiet --no-python-version-warning --disable-pip-version-check -U -r ${ROOT_DIR}/api/requirements.txt cd ${ROOT_DIR}/api In my coverage file I see that lines are called that are not in the file:
I will try to replace it with coverage version 6.5, but this is a temporary solution. |
Also facing this issue and I can't seem to get python version: 3.7
and then
coveragerc:
|
@mushyshah Can you provide me with a way to reproduce the error? |
Seeing same error and it seems kind of random |
I could get rid of this error by removing my old |
I also see this error when running this:
(
I can't easily give you a reproducible setup right now. It happens locally, but I have a lot f tests. When I ran fewer tests (with But I have a link to an open repo: https://github.com/FlexMeasures/flexmeasures/actions/runs/4841139765/jobs/8627196789?pr=655 And I can attach the .coverage file (renamed so I'm allowed to upload here) |
I did not have any luck with deleting I run Python3.9 and coverage 7.2.2. .coveragerc:
Removing |
#1362 and #1620 are other reports of this same problem. @joshlincoln, @nlou9, @nhoening, @RomainBrault, @ewianda, @mushyshah, @AnastasiiaTomashevska, @mdantonio: can anyone show a full reproduction, including source code? It seems like a lot of people have this issue, but only on private repos? |
Above, I linked to this happening in a public repo. Is that helpful? |
@nhoening Thanks, I misunderstood your message. I thought you said it wasn't reproducible with your repo. I tried it, and I don't see the error. I ran under Python3.9, but had a large number of test failures:
When I ran Can you provide more details about how exactly to reproduce the failure? Include every step, even the "pip install", etc. Thanks! |
Unfortunately I'm unable to get it reproduced in a sharable way 😞 |
@nedbat Yes running the tests in that repo requires a test postgres database to be present (see the github action workflow). In this PR, the run I linked to happens. I'm not sure what you need - probably a way to reproduce the problem on your local machine. I don't have time to verify right now what a fresh install would do, but I believe it involves setting up the test db with the commands below, then running If that doesn't work, maybe I can attempt a better reproduction later. Test database setup (from https://flexmeasures.readthedocs.io/en/latest/host/data.html)
And in the database:
|
@nedbat
Then, for me
I also ran it like you did - without a test database and many tests failing (not all). In that case, |
Does this work for you?
Your Makefile has:
So I get this:
|
It seems I could generate xml fine but not lcov
|
@nlou9 Thanks, but I need a repo that I can use to demonstrate the problem. Could you provide me with the repo, even privately? I'm willing to devote time and energy. Can you chip in a repo? |
wonder if you have a slack or other contact that we could discuss this |
After I add the
|
I apologize @nedbat we just stopped calling
|
@nhoening I still need to work out how to get the database going. I'm hoping maybe you'll come up with a way to reproduce it without that. I run these in Docker containers. @nlou9 You can find me in the Boston Python Slack workspace: https://about.bostonpython.com/slack, or in the Python Discord: https://pythondiscord.com. |
@nedbat we describe how to use Docker, also for the database, in a tutorial. |
@nedbat thanks! found you on the slack. talk there |
@nlou9 provided a small reproduction: https://github.com/nlou9/coverage The problem in that repo is a file templated by Jinja2. The file happens to be valid Python, although it is a JSON data file. It's important that it be valid Python for the bug to happen. @nhoening I see you use Jinja2 also. What kind of files are you templating? Others who have had this problem: are you using Jinja2, and are you templating files that are valid Python syntax (even if they are not Python files)? |
I don't believe we are templating anything but HTML views and emails. |
We have several jinja2 templates, but I found none that seems to be also valid as python syntax (and all of them are .html, if that matters) |
@nhoening can you show the output of |
@nedbat I see indeed Jinja2 templates in there, although as I said I don't believe any would pass as Python code. But maybe you'll find something there. Code is at https://github.com/FlexMeasures/flexmeasures/ I did this on the up-to-date main branch.
|
Thanks everyone for persisting with me. If you can, install this branch of coverage which will show the file that makes lcov fail. The output will include the name and contents of the file. Post your results here if you are comfortable.
|
@nhoening for your situation, the file might be |
(sorry, first edit was wrong branch) |
Thanks! That Jinja template is syntactically correct Python which can be compiled: {{ _fsdomain('You can now choose a new FlexMeasures password.') }}
{{ _fsdomain('Click the link below to reset your password:') }}
{{ reset_link }}
(although it couldn't execute for a few reasons...) |
My idea of valid Python is expanding today! Curly braces can denote sets, so it is valid, but it doesn't run:
It's not a |
OK, here is the full story. This code reproduces the problem: # repro_1553.py
from pathlib import Path
import jinja2
Path("good.j2").write_text("""\
{{ data }}
line2
line3
""")
Path("bad.j2").write_text("""\
This is data: {{ data }}.
line 2
line 3
""")
loader = jinja2.FileSystemLoader(".")
env = jinja2.Environment(loader=loader)
for fname in ["good", "bad"]:
template = env.get_template(f"{fname}.j2")
text = template.render(data="DATA")
print(f"{fname}: {text}") Here we're making two Jinja templates: one (good.j2) can be compiled but not run as Python code, the other (bad.j2) is syntactically invalid Python. Install jinja2 and coverage, then run it:
You can look at the data that coverage has collected:
Both bad.j2 and good.j2 are in the list, but with more lines that are in the files. This is because when Jinja2 renders a template, it compiles it to a Python file, then runs the Python file. But when it runs it, it tells Python that the file name is the original template file name. So the Python code runs, but Python thinks the file name is "bad.j2" for example. All of the reporting functions do something wrong with this data.
This happens because the lcov format records a hash of each source line. To do this, we try to read the nth line from the source file. So we try to grab line 4 from good.j2, but there is no line 4, causing the IndexError. But other reporting functions also do strange things.
All the reporting functions skip bad.j2 because it can't be parsed as Python code. Because good.j2 can be parsed, it causes the Jinja/Python confusion that leads to incorrect reporting. The JSON report records line numbers for good.j2 that were run in the Python code, but don't exist in the good.j2 file: {
"files": {
"good.j2": {
"executed_lines": [ 1, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15, 16 ],
"summary": {
"covered_lines": 2,
"num_statements": 3,
"percent_covered": 66.66666666666667,
"percent_covered_display": "67",
"missing_lines": 1,
"excluded_lines": 0
},
"missing_lines": [ 3 ],
"excluded_lines": []
},
"repro_1553.py": {
"executed_lines": [ 3, 4, 6, 11, 17, 18, 19, 20, 21, 22 ],
"summary": {
"covered_lines": 10,
"num_statements": 10,
"percent_covered": 100,
"percent_covered_display": "100",
"missing_lines": 0,
"excluded_lines": 0
},
"missing_lines": [],
"excluded_lines": []
}
}
} (Notice that good.j2 says num_statements is 3, but has 14 executed lines.) So, what to do? There are a few options:
|
Certainly 2) is a good idea for us users. Maybe the docs can help us, by linking the error message to an explanation and possible fix. Hopefully that would also in time be found by searching the web for the error message. |
…676) * docs: improve developer tutorial on how to run tests, incl. coverage * add a docker command for running a database to test against * exclude jinja templates from coverage, see nedbat/coveragepy#1553 * use the new make command from PR #672 * correct syntax type for docker call * add dollar signs * small text improvements
This is now released as part of coverage 7.2.6. |
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [coverage](https://github.com/nedbat/coveragepy) | `==7.2.5` -> `==7.2.6` | [![age](https://badges.renovateapi.com/packages/pypi/coverage/7.2.6/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/pypi/coverage/7.2.6/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/pypi/coverage/7.2.6/compatibility-slim/7.2.5)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/pypi/coverage/7.2.6/confidence-slim/7.2.5)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>nedbat/coveragepy</summary> ### [`v7.2.6`](https://github.com/nedbat/coveragepy/blob/HEAD/CHANGES.rst#Version-726--2023-05-23) [Compare Source](https://github.com/nedbat/coveragepy/compare/7.2.5...7.2.6) - Fix: the `lcov` command could raise an IndexError exception if a file is translated to Python but then executed under its own name. Jinja2 does this when rendering templates. Fixes `issue 1553`\_. - Python 3.12 beta 1 now inlines comprehensions. Previously they were compiled as invisible functions and coverage.py would warn you if they weren't completely executed. This no longer happens under Python 3.12. - Fix: the `coverage debug sys` command includes some environment variables in its output. This could have included sensitive data. Those values are now hidden with asterisks, closing `issue 1628`\_. .. \_issue 1553:[https://github.com/nedbat/coveragepy/issues/1553](https://github.com/nedbat/coveragepy/issues/1553)3 .. \_issue 1628[https://github.com/nedbat/coveragepy/issues/1628](https://github.com/nedbat/coveragepy/issues/1628)28 .. \_changes\_7-2-5: </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/allenporter/flux-local). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS45OC40IiwidXBkYXRlZEluVmVyIjoiMzUuOTguNCIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Just upgraded and I confirm that we are no longer experiencing this issue, thank you! 🙏 |
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [coverage](https://github.com/nedbat/coveragepy) | `==7.2.5` -> `==7.2.7` | [![age](https://developer.mend.io/api/mc/badges/age/pypi/coverage/7.2.7?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/pypi/coverage/7.2.7?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/pypi/coverage/7.2.5/7.2.7?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/pypi/coverage/7.2.5/7.2.7?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [mkdocs-material](https://github.com/squidfunk/mkdocs-material) | `==9.1.9` -> `==9.1.19` | [![age](https://developer.mend.io/api/mc/badges/age/pypi/mkdocs-material/9.1.19?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/pypi/mkdocs-material/9.1.19?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/pypi/mkdocs-material/9.1.9/9.1.19?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/pypi/mkdocs-material/9.1.9/9.1.19?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [mock](http://mock.readthedocs.org/en/latest/) ([source](https://github.com/testing-cabal/mock)) | `==5.0.2` -> `==5.1.0` | [![age](https://developer.mend.io/api/mc/badges/age/pypi/mock/5.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/pypi/mock/5.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/pypi/mock/5.0.2/5.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/pypi/mock/5.0.2/5.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [pyright](https://github.com/RobertCraigie/pyright-python) | `==1.1.306` -> `==1.1.317` | [![age](https://developer.mend.io/api/mc/badges/age/pypi/pyright/1.1.317?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/pypi/pyright/1.1.317?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/pypi/pyright/1.1.306/1.1.317?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/pypi/pyright/1.1.306/1.1.317?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [pytest](https://docs.pytest.org/en/latest/) ([source](https://github.com/pytest-dev/pytest), [changelog](https://docs.pytest.org/en/stable/changelog.html)) | `==7.3.1` -> `==7.4.0` | [![age](https://developer.mend.io/api/mc/badges/age/pypi/pytest/7.4.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/pypi/pytest/7.4.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/pypi/pytest/7.3.1/7.4.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/pypi/pytest/7.3.1/7.4.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [pytest-asyncio](https://github.com/pytest-dev/pytest-asyncio) ([changelog](https://pytest-asyncio.readthedocs.io/en/latest/reference/changelog.html)) | `==0.21.0` -> `==0.21.1` | [![age](https://developer.mend.io/api/mc/badges/age/pypi/pytest-asyncio/0.21.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/pypi/pytest-asyncio/0.21.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/pypi/pytest-asyncio/0.21.0/0.21.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/pypi/pytest-asyncio/0.21.0/0.21.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [pytest-mock](https://github.com/pytest-dev/pytest-mock) ([changelog](https://pytest-mock.readthedocs.io/en/latest/changelog.html)) | `==3.10.0` -> `==3.11.1` | [![age](https://developer.mend.io/api/mc/badges/age/pypi/pytest-mock/3.11.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/pypi/pytest-mock/3.11.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/pypi/pytest-mock/3.10.0/3.11.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/pypi/pytest-mock/3.10.0/3.11.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>nedbat/coveragepy (coverage)</summary> ### [`v7.2.7`](https://github.com/nedbat/coveragepy/blob/HEAD/CHANGES.rst#Version-727--2023-05-29) [Compare Source](https://github.com/nedbat/coveragepy/compare/7.2.6...7.2.7) - Fix: reverted a `change from 6.4.3 <pull 1347_>`\_ that helped Cython, but also increased the size of data files when using dynamic contexts, as described in the now-fixed `issue 1586`*. The problem is now avoided due to a recent change (`issue 1538`*). Thanks to `Anders Kaseorg <pull 1629_>`\_ and David Szotten for persisting with problem reports and detailed diagnoses. - Wheels are now provided for CPython 3.12. .. \_issue 1586:[https://github.com/nedbat/coveragepy/issues/1586](https://github.com/nedbat/coveragepy/issues/1586)6 .. \_pull 1629[https://github.com/nedbat/coveragepy/pull/1629](https://github.com/nedbat/coveragepy/pull/1629)29 .. \_changes\_7-2-6: ### [`v7.2.6`](https://github.com/nedbat/coveragepy/blob/HEAD/CHANGES.rst#Version-726--2023-05-23) [Compare Source](https://github.com/nedbat/coveragepy/compare/7.2.5...7.2.6) - Fix: the `lcov` command could raise an IndexError exception if a file is translated to Python but then executed under its own name. Jinja2 does this when rendering templates. Fixes `issue 1553`\_. - Python 3.12 beta 1 now inlines comprehensions. Previously they were compiled as invisible functions and coverage.py would warn you if they weren't completely executed. This no longer happens under Python 3.12. - Fix: the `coverage debug sys` command includes some environment variables in its output. This could have included sensitive data. Those values are now hidden with asterisks, closing `issue 1628`\_. .. \_issue 1553:[https://github.com/nedbat/coveragepy/issues/1553](https://github.com/nedbat/coveragepy/issues/1553)3 .. \_issue 1628[https://github.com/nedbat/coveragepy/issues/1628](https://github.com/nedbat/coveragepy/issues/1628)28 .. \_changes\_7-2-5: </details> <details> <summary>squidfunk/mkdocs-material (mkdocs-material)</summary> ### [`v9.1.19`](https://github.com/squidfunk/mkdocs-material/releases/tag/9.1.19): mkdocs-material-9.1.19 [Compare Source](https://github.com/squidfunk/mkdocs-material/compare/9.1.18...9.1.19) - Added support for MkDocs 1.5+ - Fixed [#​5699](https://github.com/squidfunk/mkdocs-material/issues/5699): Improve error reporting in social plugin ### [`v9.1.18`](https://github.com/squidfunk/mkdocs-material/releases/tag/9.1.18): mkdocs-material-9.1.18 [Compare Source](https://github.com/squidfunk/mkdocs-material/compare/9.1.17...9.1.18) - Updated Danish translations - Added support for installing user requirements in Docker image - Fixed [#​5655](https://github.com/squidfunk/mkdocs-material/issues/5655): Search separator with lookbehind breaks highlighting ### [`v9.1.17`](https://github.com/squidfunk/mkdocs-material/releases/tag/9.1.17): mkdocs-material-9.1.17 [Compare Source](https://github.com/squidfunk/mkdocs-material/compare/9.1.16...9.1.17) - Fixed [#​5633](https://github.com/squidfunk/mkdocs-material/issues/5633): Code annotations with nested lists incorrectly mounted - Fixed [#​5628](https://github.com/squidfunk/mkdocs-material/issues/5628): Regression in new social plugin configuration scheme ### [`v9.1.16`](https://github.com/squidfunk/mkdocs-material/releases/tag/9.1.16): mkdocs-material-9.1.16 [Compare Source](https://github.com/squidfunk/mkdocs-material/compare/9.1.15...9.1.16) - Updated Indonesian translations - Ensure scroll bar follows color scheme of operating system ### [`v9.1.15`](https://github.com/squidfunk/mkdocs-material/releases/tag/9.1.15): mkdocs-material-9.1.15 [Compare Source](https://github.com/squidfunk/mkdocs-material/compare/9.1.14...9.1.15) - Fixed [#​5566](https://github.com/squidfunk/mkdocs-material/issues/5566): Indicate color scheme to operating system - Fixed [#​5565](https://github.com/squidfunk/mkdocs-material/issues/5565): Update `Dockerfile` to latest version of base image - Fixed [#​5554](https://github.com/squidfunk/mkdocs-material/issues/5554): Add additional version tags (`9`, `9.1`) to Docker image - Fixed [#​5536](https://github.com/squidfunk/mkdocs-material/issues/5536): Strip tags of ARIA labels in table of contents ### [`v9.1.14`](https://github.com/squidfunk/mkdocs-material/releases/tag/9.1.14): mkdocs-material-9.1.14 [Compare Source](https://github.com/squidfunk/mkdocs-material/compare/9.1.13...9.1.14) - Updated Armenian and Greek translations ### [`v9.1.13`](https://github.com/squidfunk/mkdocs-material/releases/tag/9.1.13): mkdocs-material-9.1.13 [Compare Source](https://github.com/squidfunk/mkdocs-material/compare/9.1.12...9.1.13) - Fixed [#​5517](https://github.com/squidfunk/mkdocs-material/issues/5517): Social plugin crashes for some fonts (e.g. Open Sans) ### [`v9.1.12`](https://github.com/squidfunk/mkdocs-material/releases/tag/9.1.12): mkdocs-material-9.1.12 [Compare Source](https://github.com/squidfunk/mkdocs-material/compare/9.1.11...9.1.12) - Updated Bengali (Bangla) translations - Fixed [#​5503](https://github.com/squidfunk/mkdocs-material/issues/5503): Docker image publish errors on uppercase characters - Fixed [#​5407](https://github.com/squidfunk/mkdocs-material/issues/5407): Auto-pause media when in hidden content tabs ### [`v9.1.11`](https://github.com/squidfunk/mkdocs-material/releases/tag/9.1.11): mkdocs-material-9.1.11 [Compare Source](https://github.com/squidfunk/mkdocs-material/compare/9.1.10...9.1.11) - Fixed [#​5487](https://github.com/squidfunk/mkdocs-material/issues/5487): Social plugin crashes without options (9.1.10 regression) ### [`v9.1.10`](https://github.com/squidfunk/mkdocs-material/releases/tag/9.1.10): mkdocs-material-9.1.10 [Compare Source](https://github.com/squidfunk/mkdocs-material/compare/9.1.9...9.1.10) - Added `cards_layout_options` setting for social cards - Deprecated `cards_color` and `cards_font` setting for social cards </details> <details> <summary>testing-cabal/mock (mock)</summary> ### [`v5.1.0`](https://github.com/testing-cabal/mock/blob/HEAD/CHANGELOG.rst#510) [Compare Source](https://github.com/testing-cabal/mock/compare/5.0.2...5.1.0) - bpo-44185: :func:`unittest.mock.mock_open` will call the :func:`close` method of the file handle mock when it is exiting from the context manager. Patch by Samet Yaslan. - [gh-94924](https://github.com/testing-cabal/mock/issues/94924): :func:`unittest.mock.create_autospec` now properly returns coroutine functions compatible with :func:`inspect.iscoroutinefunction` - bpo-17013: Add `ThreadingMock` to :mod:`unittest.mock` that can be used to create Mock objects that can wait until they are called. Patch by Karthikeyan Singaravelan and Mario Corchero. - bpo-41768: :mod:`unittest.mock` speccing no longer calls class properties. Patch by Melanie Witt. </details> <details> <summary>RobertCraigie/pyright-python (pyright)</summary> ### [`v1.1.317`](https://github.com/RobertCraigie/pyright-python/compare/v1.1.316...v1.1.317) [Compare Source](https://github.com/RobertCraigie/pyright-python/compare/v1.1.316...v1.1.317) ### [`v1.1.316`](https://github.com/RobertCraigie/pyright-python/compare/v1.1.315...v1.1.316) [Compare Source](https://github.com/RobertCraigie/pyright-python/compare/v1.1.315...v1.1.316) ### [`v1.1.315`](https://github.com/RobertCraigie/pyright-python/compare/v1.1.314...v1.1.315) [Compare Source](https://github.com/RobertCraigie/pyright-python/compare/v1.1.314...v1.1.315) ### [`v1.1.314`](https://github.com/RobertCraigie/pyright-python/compare/v1.1.313...v1.1.314) [Compare Source](https://github.com/RobertCraigie/pyright-python/compare/v1.1.313...v1.1.314) ### [`v1.1.313`](https://github.com/RobertCraigie/pyright-python/compare/v1.1.312...v1.1.313) [Compare Source](https://github.com/RobertCraigie/pyright-python/compare/v1.1.312...v1.1.313) ### [`v1.1.312`](https://github.com/RobertCraigie/pyright-python/compare/v1.1.311...v1.1.312) [Compare Source](https://github.com/RobertCraigie/pyright-python/compare/v1.1.311...v1.1.312) ### [`v1.1.311`](https://github.com/RobertCraigie/pyright-python/compare/v1.1.310...v1.1.311) [Compare Source](https://github.com/RobertCraigie/pyright-python/compare/v1.1.310...v1.1.311) ### [`v1.1.310`](https://github.com/RobertCraigie/pyright-python/compare/v1.1.309...v1.1.310) [Compare Source](https://github.com/RobertCraigie/pyright-python/compare/v1.1.309...v1.1.310) ### [`v1.1.309`](https://github.com/RobertCraigie/pyright-python/compare/v1.1.308...v1.1.309) [Compare Source](https://github.com/RobertCraigie/pyright-python/compare/v1.1.308...v1.1.309) ### [`v1.1.308`](https://github.com/RobertCraigie/pyright-python/compare/v1.1.307...v1.1.308) [Compare Source](https://github.com/RobertCraigie/pyright-python/compare/v1.1.307...v1.1.308) ### [`v1.1.307`](https://github.com/RobertCraigie/pyright-python/compare/v1.1.306...v1.1.307) [Compare Source](https://github.com/RobertCraigie/pyright-python/compare/v1.1.306...v1.1.307) </details> <details> <summary>pytest-dev/pytest (pytest)</summary> ### [`v7.4.0`](https://github.com/pytest-dev/pytest/releases/tag/7.4.0) [Compare Source](https://github.com/pytest-dev/pytest/compare/7.3.2...7.4.0) # pytest 7.4.0 (2023-06-23) ## Features - [#​10901](https://github.com/pytest-dev/pytest/issues/10901): Added `ExceptionInfo.from_exception() <pytest.ExceptionInfo.from_exception>`{.interpreted-text role="func"}, a simpler way to create an `~pytest.ExceptionInfo`{.interpreted-text role="class"} from an exception. This can replace `ExceptionInfo.from_exc_info() <pytest.ExceptionInfo.from_exc_info()>`{.interpreted-text role="func"} for most uses. ## Improvements - [#​10872](https://github.com/pytest-dev/pytest/issues/10872): Update test log report annotation to named tuple and fixed inconsistency in docs for `pytest_report_teststatus`{.interpreted-text role="hook"} hook. - [#​10907](https://github.com/pytest-dev/pytest/issues/10907): When an exception traceback to be displayed is completely filtered out (by mechanisms such as `__tracebackhide__`, internal frames, and similar), now only the exception string and the following message are shown: "All traceback entries are hidden. Pass \[--full-trace]{.title-ref} to see hidden and internal frames.". Previously, the last frame of the traceback was shown, even though it was hidden. - [#​10940](https://github.com/pytest-dev/pytest/issues/10940): Improved verbose output (`-vv`) of `skip` and `xfail` reasons by performing text wrapping while leaving a clear margin for progress output. Added `TerminalReporter.wrap_write()` as a helper for that. - [#​10991](https://github.com/pytest-dev/pytest/issues/10991): Added handling of `%f` directive to print microseconds in log format options, such as `log-date-format`. - [#​11005](https://github.com/pytest-dev/pytest/issues/11005): Added the underlying exception to the cache provider's path creation and write warning messages. - [#​11013](https://github.com/pytest-dev/pytest/issues/11013): Added warning when `testpaths`{.interpreted-text role="confval"} is set, but paths are not found by glob. In this case, pytest will fall back to searching from the current directory. - [#​11043](https://github.com/pytest-dev/pytest/issues/11043): When \[--confcutdir]{.title-ref} is not specified, and there is no config file present, the conftest cutoff directory (\[--confcutdir]{.title-ref}) is now set to the `rootdir <rootdir>`{.interpreted-text role="ref"}. Previously in such cases, \[conftest.py]{.title-ref} files would be probed all the way to the root directory of the filesystem. If you are badly affected by this change, consider adding an empty config file to your desired cutoff directory, or explicitly set \[--confcutdir]{.title-ref}. - [#​11081](https://github.com/pytest-dev/pytest/issues/11081): The `norecursedirs`{.interpreted-text role="confval"} check is now performed in a `pytest_ignore_collect`{.interpreted-text role="hook"} implementation, so plugins can affect it. If after updating to this version you see that your \[norecursedirs]{.title-ref} setting is not being respected, it means that a conftest or a plugin you use has a bad \[pytest_ignore_collect]{.title-ref} implementation. Most likely, your hook returns \[False]{.title-ref} for paths it does not want to ignore, which ends the processing and doesn't allow other plugins, including pytest itself, to ignore the path. The fix is to return \[None]{.title-ref} instead of \[False]{.title-ref} for paths your hook doesn't want to ignore. - [#​8711](https://github.com/pytest-dev/pytest/issues/8711): `caplog.set_level() <pytest.LogCaptureFixture.set_level>`{.interpreted-text role="func"} and `caplog.at_level() <pytest.LogCaptureFixture.at_level>`{.interpreted-text role="func"} will temporarily enable the requested `level` if `level` was disabled globally via `logging.disable(LEVEL)`. ## Bug Fixes - [#​10831](https://github.com/pytest-dev/pytest/issues/10831): Terminal Reporting: Fixed bug when running in `--tb=line` mode where `pytest.fail(pytrace=False)` tests report `None`. - [#​11068](https://github.com/pytest-dev/pytest/issues/11068): Fixed the `--last-failed` whole-file skipping functionality ("skipped N files") for `non-python test files <non-python tests>`{.interpreted-text role="ref"}. - [#​11104](https://github.com/pytest-dev/pytest/issues/11104): Fixed a regression in pytest 7.3.2 which caused to `testpaths`{.interpreted-text role="confval"} to be considered for loading initial conftests, even when it was not utilized (e.g. when explicit paths were given on the command line). Now the `testpaths` are only considered when they are in use. - [#​1904](https://github.com/pytest-dev/pytest/issues/1904): Fixed traceback entries hidden with `__tracebackhide__ = True` still being shown for chained exceptions (parts after "... the above exception ..." message). - [#​7781](https://github.com/pytest-dev/pytest/issues/7781): Fix writing non-encodable text to log file when using `--debug`. ## Improved Documentation - [#​9146](https://github.com/pytest-dev/pytest/issues/9146): Improved documentation for `caplog.set_level() <pytest.LogCaptureFixture.set_level>`{.interpreted-text role="func"}. ## Trivial/Internal Changes - [#​11031](https://github.com/pytest-dev/pytest/issues/11031): Enhanced the CLI flag for `-c` to now include `--config-file` to make it clear that this flag applies to the usage of a custom config file. ### [`v7.3.2`](https://github.com/pytest-dev/pytest/releases/tag/7.3.2) [Compare Source](https://github.com/pytest-dev/pytest/compare/7.3.1...7.3.2) # pytest 7.3.2 (2023-06-10) ## Bug Fixes - [#​10169](https://github.com/pytest-dev/pytest/issues/10169): Fix bug where very long option names could cause pytest to break with `OSError: [Errno 36] File name too long` on some systems. - [#​10894](https://github.com/pytest-dev/pytest/issues/10894): Support for Python 3.12 (beta at the time of writing). - [#​10987](https://github.com/pytest-dev/pytest/issues/10987): `testpaths`{.interpreted-text role="confval"} is now honored to load root `conftests`. - [#​10999](https://github.com/pytest-dev/pytest/issues/10999): The \[monkeypatch]{.title-ref} \[setitem]{.title-ref}/\[delitem]{.title-ref} type annotations now allow \[TypedDict]{.title-ref} arguments. - [#​11028](https://github.com/pytest-dev/pytest/issues/11028): Fixed bug in assertion rewriting where a variable assigned with the walrus operator could not be used later in a function call. - [#​11054](https://github.com/pytest-dev/pytest/issues/11054): Fixed `--last-failed`'s "(skipped N files)" functionality for files inside of packages (directories with \[\__init\_\_.py]{.title-ref} files). </details> <details> <summary>pytest-dev/pytest-asyncio (pytest-asyncio)</summary> ### [`v0.21.1`](https://github.com/pytest-dev/pytest-asyncio/releases/tag/v0.21.1): pytest-asyncio 0.21.1 [Compare Source](https://github.com/pytest-dev/pytest-asyncio/compare/v0.21.0...v0.21.1) ### 0.21.1 (2023-07-12) - Output a proper error message when an invalid `asyncio_mode` is selected. - Extend warning message about unclosed event loops with additional possible cause. [#​531](https://github.com/pytest-dev/pytest-asyncio/issues/531) - Previously, some tests reported "skipped" or "xfailed" as a result. Now all tests report a "success" result. </details> <details> <summary>pytest-dev/pytest-mock (pytest-mock)</summary> ### [`v3.11.1`](https://github.com/pytest-dev/pytest-mock/blob/HEAD/CHANGELOG.rst#3111-2023-06-15) [Compare Source](https://github.com/pytest-dev/pytest-mock/compare/v3.11.0...v3.11.1) (This release source code is identical to `3.11.0` except a small internal fix to deployment/CI) - Fixed introspection for failed `assert_has_calls` (`#365`\_). - Updated type annotations for `mocker.patch` and `mocker.spy` (`#364`\_). .. \_#365:[https://github.com/pytest-dev/pytest-mock/pull/365](https://github.com/pytest-dev/pytest-mock/pull/365)5 .. \_#364[https://github.com/pytest-dev/pytest-mock/pull/364](https://github.com/pytest-dev/pytest-mock/pull/364)64 ### [`v3.11.0`](https://github.com/pytest-dev/pytest-mock/blob/HEAD/CHANGELOG.rst#3110-2023-06-15) [Compare Source](https://github.com/pytest-dev/pytest-mock/compare/v3.10.0...v3.11.0) - Fixed introspection for failed `assert_has_calls` (`#365`\_). - Updated type annotations for `mocker.patch` and `mocker.spy` (`#364`\_). .. \_#365:[https://github.com/pytest-dev/pytest-mock/pull/365](https://github.com/pytest-dev/pytest-mock/pull/365)5 .. \_#364[https://github.com/pytest-dev/pytest-mock/pull/364](https://github.com/pytest-dev/pytest-mock/pull/364)64 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://github.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/RobertCraigie/prisma-client-py). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS43NC4wIiwidXBkYXRlZEluVmVyIjoiMzYuOC4xMSIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==--> --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Robert Craigie <robert@craigie.dev>
Describe the bug
I'm running coverage lcov and getting the following error:
IndexError: list index out of range
This error mostly match this old report: #1362
To Reproduce
How can we reproduce the problem? Please be specific. Don't link to a failing CI job. Answer the questions below:
3.10.8
coverage debug sys
is helpful.pip freeze
is helpful.Expected behavior
I expect it to write to the lcov file without error
Additional context
Add any other context about the problem here.
I was playing with the
.coverage -> coverage.lcov
conversion and I noticed a different behaviour between coverage 6.5.0 and any 7.x versionversion 7 fails with error:
while coverage 6 is fine:
But also the report is different,
coverage 6 only reports few files (only from the first
--cov
)On the opposite coverage 7 reports the whole list of files from all the
--cov
Probably the fact that coverage 6 is successful is because it is only consider a few files and this other issue was about coverage version 6.3.2, so I don't think it is a regression with coverage 7
The text was updated successfully, but these errors were encountered: