-
-
Notifications
You must be signed in to change notification settings - Fork 438
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
py39: branch coverage reports uncovered return branch #1041
Comments
On bisecting this seems to have been due to changes made in python/cpython#6641 |
thanks for a detailed bug report @a-feld and analysis @tirkarthi! you both just saved me a lot of digging! 🙌 I'm dealing with something similar here https://github.com/pypyr/pypyr/blob/d4a36f0dbf6a3e47773dadfb8deebd73aa1e0bcf/pypyr/dsl.py#L463 Code is definitely covered and used to pass 100% covered with py 3.6 through to py 3.8. As of py 3.9, reports |
In the move to Python 3.9, we are subject to a coverage behavior that has yet to be corrected. In the interest of keeping the coverage report to 100%, we exclude the statement that coverage.py reports as not being executed, despite it being executed via tests. Refs: nedbat/coveragepy#1041 Signed-off-by: Mike Fiedler <[email protected]>
* chore: update local/CI execution to Python 3.9 For the development (outer) environment, update to Python 3.9.10 - latest as of this writing. Signed-off-by: Mike Fiedler <[email protected]> * chore: upgrade python version Move us to 3.9.10 - latest release. Signed-off-by: Mike Fiedler <[email protected]> * chore: update requrements hashes for python3.9 * test: exclude statement from coverage report In the move to Python 3.9, we are subject to a coverage behavior that has yet to be corrected. In the interest of keeping the coverage report to 100%, we exclude the statement that coverage.py reports as not being executed, despite it being executed via tests. Refs: nedbat/coveragepy#1041 Signed-off-by: Mike Fiedler <[email protected]> Co-authored-by: Dustin Ingram <[email protected]>
* chore: update local/CI execution to Python 3.9 For the development (outer) environment, update to Python 3.9.10 - latest as of this writing. Signed-off-by: Mike Fiedler <[email protected]> * chore: upgrade python version Move us to 3.9.10 - latest release. Signed-off-by: Mike Fiedler <[email protected]> * chore: update requrements hashes for python3.9 * test: exclude statement from coverage report In the move to Python 3.9, we are subject to a coverage behavior that has yet to be corrected. In the interest of keeping the coverage report to 100%, we exclude the statement that coverage.py reports as not being executed, despite it being executed via tests. Refs: nedbat/coveragepy#1041 Signed-off-by: Mike Fiedler <[email protected]> Co-authored-by: Dustin Ingram <[email protected]>
Describe the bug
Coverage reports return statement as uncovered when branch coverage is enabled in py39.
To Reproduce
example.py
command
coverage run --branch example.py && coverage html
environment
Python Version: Python 3.9.0
coverage.py version: Coverage.py, version 5.3 with C extension (although without C extension reports the same results)
Expected behavior
coverage reports the return statement as covered in Python 3.9, the same as Python 3.8
Additional context
From what I can see, the disassembly of main in example.py is different in py38 versus py39
Coverage is expecting an arc from the return statement to the first code line. In py38, this arc occurs. In py39, this arc does not occur.
When using sys.settrace with a debug function, the outputs are different between py38 and py39.
py38 output:
py39 output:
The text was updated successfully, but these errors were encountered: