Skip to content
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

continue incorrectly marked as uncovered on python 3.9 #1794

Closed
jakkdl opened this issue May 29, 2024 · 2 comments
Closed

continue incorrectly marked as uncovered on python 3.9 #1794

jakkdl opened this issue May 29, 2024 · 2 comments
Labels
bug Something isn't working duplicate This issue or pull request already exists

Comments

@jakkdl
Copy link

jakkdl commented May 29, 2024

Describe the bug
This one random line is being marked as uncovered on python3.9, despite it clearly being executed.

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.9.19
    The problem does not appear on py310, 311, 312 or 313.

  2. What version of coverage.py shows the problem? The output of coverage debug sys is helpful.
    7.5.3, I also tried 7.4.4 and 7.4.0 with the same behaviour

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

attrs==23.2.0
coverage==7.5.3
exceptiongroup==1.2.1
flake8==7.0.0
flake8-async @ file:///tmp/repro_coverage_fail/flake8-async
hypothesis==6.103.0
hypothesmith==0.3.3
iniconfig==2.0.0
lark==1.1.9
libcst==1.4.0
mccabe==0.7.0
packaging==24.0
pluggy==1.5.0
pycodestyle==2.11.1
pyflakes==3.2.0
pytest==8.2.1
PyYAML==6.0.1
sortedcontainers==2.4.0
tomli==2.0.1
  1. 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.
    https://github.com/jakkdl/flake8-async/tree/async111_asyncio
    commit jakkdl/flake8-async@2cf2519
  2. 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!
git clone https://github.com/jakkdl/flake8-async.git
cd flake8-async
git checkout 2cf2519198db2adbd52581e481acf9a054bbe294
python3.9 -m venv .venv
source .venv/bin/activate
pip install . coverage hypothesis hypothesmith pytest
coverage run -m pytest -k async112-trio-noautofix-normal
coverage html

Line 131 (continue) in the file flake8_async/visitors/visitors.py is marked as uncovered, despite line 130 (assert True) being marked as covered.

Expected behavior
The line should be marked as covered, as it is clearly being executed. If you replace the assert True on line 130 with assert False you get an AssertionError when running the test.

Additional context
First encountered in CI run https://github.com/python-trio/flake8-async/actions/runs/9287086418/job/25558523200?pr=264#step:5:1
PR: python-trio/flake8-async#264

@jakkdl jakkdl added bug Something isn't working needs triage labels May 29, 2024
@nedbat
Copy link
Owner

nedbat commented May 29, 2024

This is due to how Python traced code in 3.9. It's been fixed in 3.10. The coverage.py issue about it in #198.

@nedbat nedbat closed this as not planned Won't fix, can't repro, duplicate, stale May 29, 2024
@nedbat nedbat added duplicate This issue or pull request already exists and removed needs triage labels May 29, 2024
@jakkdl
Copy link
Author

jakkdl commented May 30, 2024

thank you, and sorry for the duplicate! I somehow didn't find the issue when searching

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants