We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
else : continue
Coverage report will miss hits for else: continue during a for loop.
else: continue
Here is a minimal reproducible example here.
python==3.8.12 pytest==5.2.1
foo.py
def foo(): for i in range(10): if i < 10: pass else : continue return 5 def foo2(): for i in range(10): if i == 9: pass else: continue return 5
test_foo.py
from poj.foo import foo, foo2 def test_foo(): assert foo() == 5 assert foo2() == 5
both line 6 and 14 would have only 0 hit.
<?xml version="1.0" ?> <coverage branch-rate="0" branches-covered="0" branches-valid="0" complexity="0" line-rate="0.8333" lines-covered="10" lines-valid="12" timestamp="1635453959207" version="5.2"> <!-- Generated by coverage.py: https://coverage.readthedocs.io --> <!-- Based on https://raw.githubusercontent.com/cobertura/web/master/htdocs/xml/coverage-04.dtd --> <sources> <source>/Users/jingx/Documents/tttt/poj</source> </sources> <packages> <package branch-rate="0" complexity="0" line-rate="0.8333" name="."> <classes> <class branch-rate="0" complexity="0" filename="__init__.py" line-rate="1" name="__init__.py"> <methods/> <lines/> </class> <class branch-rate="0" complexity="0" filename="foo.py" line-rate="0.8333" name="foo.py"> <methods/> <lines> <line hits="1" number="1"/> <line hits="1" number="2"/> <line hits="1" number="3"/> <line hits="1" number="4"/> <line hits="0" number="6"/> <line hits="1" number="7"/> <line hits="1" number="9"/> <line hits="1" number="10"/> <line hits="1" number="11"/> <line hits="1" number="12"/> <line hits="0" number="14"/> <line hits="1" number="15"/> </lines> </class> </classes> </package> </packages> </coverage>
The text was updated successfully, but these errors were encountered:
Seems like this is covered there nedbat/coveragepy#198
Sorry, something went wrong.
No branches or pull requests
Coverage report will miss hits for
else: continue
during a for loop.Here is a minimal reproducible example here.
python==3.8.12
pytest==5.2.1
foo.py
test_foo.py
both line 6 and 14 would have only 0 hit.
The text was updated successfully, but these errors were encountered: