def test_redundant_jump_in_if_else_break(self):

    def if_else_break():
        val = 1
        while True:
            if (val > 0):
                val -= 1
            else:
                break
            val = (- 1)
    INSTR_SIZE = 2
    HANDLED_JUMPS = ('POP_JUMP_IF_FALSE', 'POP_JUMP_IF_TRUE', 'JUMP_ABSOLUTE', 'JUMP_FORWARD')
    for (line, instr) in enumerate(dis.Bytecode(if_else_break, show_caches=True)):
        if (instr.opname == 'JUMP_FORWARD'):
            self.assertNotEqual(instr.arg, 0)
        elif (instr.opname in HANDLED_JUMPS):
            self.assertNotEqual(instr.arg, ((line + 1) * INSTR_SIZE))
def test_redundant_jump_in_if_else_break(self):

    def if_else_break():
        val = 1
        while True:
            if (val > 0):
                val -= 1
            else:
                break
            val = (- 1)
    INSTR_SIZE = 2
    HANDLED_JUMPS = ('POP_JUMP_IF_FALSE', 'POP_JUMP_IF_TRUE', 'JUMP_ABSOLUTE', 'JUMP_FORWARD')
    for (line, instr) in enumerate(dis.Bytecode(if_else_break, show_caches=True)):
        if (instr.opname == 'JUMP_FORWARD'):
            self.assertNotEqual(instr.arg, 0)
        elif (instr.opname in HANDLED_JUMPS):
            self.assertNotEqual(instr.arg, ((line + 1) * INSTR_SIZE))