diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2016-02-15 10:11:25 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2016-02-15 10:11:25 -0500 |
commit | d77a0119140a42a848e21f3f13005bf63c7cad53 (patch) | |
tree | ac2d8c99d9a52523c67412095ed1c72ae2b336dd /tests/test_parser.py | |
parent | 708daa3402ada27986414c8b78de4fdeba16da25 (diff) | |
download | python-coveragepy-d77a0119140a42a848e21f3f13005bf63c7cad53.tar.gz |
Add missing branch explanations for while-loop
Diffstat (limited to 'tests/test_parser.py')
-rw-r--r-- | tests/test_parser.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/tests/test_parser.py b/tests/test_parser.py index 0d00409..1be5e16 100644 --- a/tests/test_parser.py +++ b/tests/test_parser.py @@ -206,8 +206,13 @@ class ParserMissingArcDescriptionTest(CoverageTest): def func5(): for x in range(6): - if x == 3: + if x == 7: break + + def func10(): + while something(11): + thing(12) + more_stuff(13) """) self.assertEqual( parser.missing_arc_description(1, 2), @@ -225,6 +230,14 @@ class ParserMissingArcDescriptionTest(CoverageTest): parser.missing_arc_description(6, 7), "line 6 didn't jump to line 7, because the loop on line 6 never started" ) + self.assertEqual( + parser.missing_arc_description(11, 12), + "line 11 didn't jump to line 12, because the condition on line 11 was never true" + ) + self.assertEqual( + parser.missing_arc_description(11, 13), + "line 11 didn't jump to line 13, because the condition on line 11 was never false" + ) def test_missing_arc_descriptions_for_small_callables(self): # We use 2.7 features here, so just skip this test on 2.6 |