def test_neg_type___new___args():
 global called
 called = False
 class MyType(type, ):
  def __new__(self):
   pass
  def __clrtype__(self):
   global called
   called = True
   return super(MyType, self).__clrtype__()
 try:
  class X(object, ):
   __metaclass__ = MyType
  Fail('type.__new__ signature is wrong')
 except TypeError as e:
  AreEqual(e.message, '__new__() takes exactly 1 argument (4 given)')
 finally:
  AreEqual(called, False)

def test_neg_type___new___args ( ) : global called called = False class MyType ( type , ) : def __new__ ( self ) : pass def __clrtype__ ( self ) : global called called = True return super ( MyType , self ) . __clrtype__ ( ) try : class X ( object , ) : __metaclass__ = MyType Fail ( 'type.__new__ signature is wrong' ) except TypeError as e : AreEqual ( e . message , '__new__() takes exactly 1 argument (4 given)' ) finally : AreEqual ( called , False )
make a type that cannot be constructed and see if __clrtype__ still gets called .