def check_constant(self, func, expected):
    for const in func.__code__.co_consts:
        if (repr(const) == repr(expected)):
            break
    else:
        self.fail(('unable to find constant %r in %r' % (expected, func.__code__.co_consts)))
def check_constant(self, func, expected):
    for const in func.__code__.co_consts:
        if (repr(const) == repr(expected)):
            break
    else:
        self.fail(('unable to find constant %r in %r' % (expected, func.__code__.co_consts)))