Skip to content

"didn't jump to function exit" with simple list comprehension in return statement #1142

@joaoe

Description

@joaoe

Describe the bug

The attached zip file has three files. The .coveragerc file with settings, the .coverage file with the sqlite db with line info and the source file coverage_target.py. There also a generated htmlcov folder which shows the bug.

Zip file -> coverage_bug_1.zip

All files were generated with coverage==5.5 while running pytest with pytest-cov==2.11.1.

The .coverage file was generated using python 2.7.
When generating the html report with python 2.7 it shows as expected 100% coverage.
When generating the html report with python 3.7 it shows 89% due to the "didn't jump to function exit". This is the bug.

Why mixing python 2 and 3 ? Because in my project we run unit tests against different versions of python to test the different compatibility code and then merge coverage results.

To Reproduce

  1. Unpack the zip file in your project folder
  2. Run python3 -mcoverage html
  3. Inspect the html report for coverage_target.py.

Expected behavior

  1. Unpack the zip file in your project folder
  2. Run python2 -mcoverage html
  3. Inspect the html report for coverage_target.py <- no message about "didn't jump to function exit"

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions