code: def test_new_returns_invalid_instance(self):
      # See issue #11627.
      class MyException(Exception):
          def __new__(cls, *args):
              return object()
  
      with self.assertRaises(TypeError):
          raise MyException
  
imports: from test import support
  import sys
  import types
  import unittest
label_desc: Use image node_id 11 for calling the TestRaise obj's underlying member method code with example usage: obj.test_new_returns_invalid_instance() and returns: object