coveragepy icon indicating copy to clipboard operation
coveragepy copied to clipboard

Line incorrectly reported as uncovered in python 3.11 involving `asyncio.to_thread` and a conditional

Open atom-andrew opened this issue 8 months ago • 0 comments

Describe the bug In python 3.11. there I've found a case involving a conditional statement and multiple asyncio.to_thread invocations that causes a line to be reported as uncovered. The problem seems to be a regression from python 3.10 to python 3.11.0 and was fixed in python 3.12.0.

To Reproduce How can we reproduce the problem? Please be specific. Don't link to a failing CI job. Answer the questions below:

  1. What version of Python are you using? 3.11

  2. What version of coverage.py shows the problem? The output of coverage debug sys is helpful. 7.5.1

  3. What versions of what packages do you have installed? The output of pip freeze is helpful. n/a

  4. What code shows the problem? Give us a specific commit of a specific repo that we can check out. If you've already worked around the problem, please provide a commit before that fix. See https://github.com/atom-computing/coverage-failure/blob/main/example.py#L21

  5. What commands should we run to reproduce the problem? Be specific. Include everything, even git clone, pip install, and so on. Explain like we're five! Clone https://github.com/atom-computing/coverage-failure with python 3.11 installed and run tox. In the workflow at https://github.com/atom-computing/coverage-failure/actions/runs/9244341369/job/25429518754, you can see that python 3.11 reports reduced coverage vs 3.10. and 3.12.

Expected behavior A clear and concise description of what you expected to happen.

Additional context Add any other context about the problem here.

atom-andrew avatar May 26 '24 15:05 atom-andrew