'Ensure our call stack test hits all function call opcodes'

def test_verify_call_opcodes(self):

    opcodes = set(['CALL_FUNCTION', 'CALL_FUNCTION_EX', 'CALL_FUNCTION_KW'])
    with open(abspath('call_stack.py')) as f:
        code_string = f.read()
    def get_function_instructions(funcname):
        code = compile(source=code_string, filename='<string>', mode='exec', optimize=self.optimize_python)
        for c in code.co_consts:
            if (isinstance(c, types.CodeType) and (c.co_name == funcname)):
                return dis.get_instructions(c)
        return []
    for instruction in get_function_instructions('start'):
        opcodes.discard(instruction.opname)
    self.assertEqual(set(), opcodes)
