def test_neg_clrtype_raises_exceptions():
 global called
 expected_msg = 'my msg'
 for x in [IOError(expected_msg), BaseException(expected_msg), Exception(expected_msg), KeyboardInterrupt(expected_msg), System.NotSupportedException(expected_msg)]:
  called = False
  class MyType(type, ):
   def __clrtype__(self):
    global called
    raise x
    called = True
  try:
   class X(object, ):
    __metaclass__ = MyType
   Fail(('Exception was never thrown from __clrtype__: ' + str(x)))
  except type(x) as e:
   if hasattr(e, 'message'):
    AreEqual(e.message, expected_msg)
   else:
    AreEqual(e.Message, expected_msg)
  finally:
   AreEqual(called, False)

def test_neg_clrtype_raises_exceptions ( ) : global called expected_msg = 'my msg' for x in [ IOError ( expected_msg ) , BaseException ( expected_msg ) , Exception ( expected_msg ) , KeyboardInterrupt ( expected_msg ) , System . NotSupportedException ( expected_msg ) ] : called = False class MyType ( type , ) : def __clrtype__ ( self ) : global called raise x called = True try : class X ( object , ) : __metaclass__ = MyType Fail ( ( 'Exception was never thrown from __clrtype__: ' + str ( x ) ) ) except type ( x ) as e : if hasattr ( e , 'message' ) : AreEqual ( e . message , expected_msg ) else : AreEqual ( e . Message , expected_msg ) finally : AreEqual ( called , False )
what happens when the __clrtype__ implementation raises exceptions? .