Commits

Ned Batchelder  committed 52789af

A test and a fix for issue #122, maybe?

  • Participants
  • Parent commits eff5359

Comments (0)

Files changed (2)

File coverage/parser.py

 OPS_POP_BLOCK = _opcode_set('POP_BLOCK')
 
 # Opcodes that have a jump destination, but aren't really a jump.
-OPS_NO_JUMP = _opcode_set('SETUP_EXCEPT', 'SETUP_FINALLY')
+OPS_NO_JUMP = OPS_PUSH_BLOCK
 
 # Individual opcodes we need below.
 OP_BREAK_LOOP = _opcode('BREAK_LOOP')

File test/test_arcs.py

             arcz_missing="26 6."
             )
 
+    def test_for_else(self):
+        self.check_coverage("""\
+            def forelse(seq):
+                for n in seq:
+                    if n > 5:
+                        break
+                else:
+                    print('None of the values were greater than 5')
+                print('Done')
+            forelse([1,2])
+            forelse([1,6])
+            """,
+            arcz=".1 .2 23 32 34 47 26 67 7. 18 89 9."
+            )
+
 
 class ExceptionArcTest(CoverageTest):
     """Arc-measuring tests involving exception handling."""