'Exception instances should match expected types.'

def test_exception_types(self):

    for params in self.valid_exceptions.values():
        instance = params['instance']
        for match_type in params['types']:
            match_type_name = match_type.__name__
            fail_msg = ('%(instance)r    is    not    an    instance    of    %(match_type_name)s' % vars())
            self.failUnless(isinstance(instance, match_type), msg=fail_msg)
