From 1319240b4e7cce5e293e0f92eb887c4b97f03239 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 18 Dec 2016 22:44:13 -0500 Subject: Fix #496, while-true loop with a continue. --- tests/test_arcs.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'tests') diff --git a/tests/test_arcs.py b/tests/test_arcs.py index 5baf9476..36eb4faa 100644 --- a/tests/test_arcs.py +++ b/tests/test_arcs.py @@ -270,6 +270,22 @@ class LoopArcTest(CoverageTest): arcz=arcz, ) + def test_bug_496_continue_in_constant_while(self): + # https://bitbucket.org/ned/coveragepy/issue/496 + if env.PY3: + arcz = ".1 12 23 34 43 45 5." + else: + arcz = ".1 12 2-1 23 34 42 45 5." + self.check_coverage("""\ + up = iter('ta') + while True: + char = next(up) + if char == 't': continue + break + """, + arcz=arcz + ) + def test_for_if_else_for(self): self.check_coverage("""\ def branches_2(l): -- cgit v1.2.1