code: def test_getitem(self):
      TestMappingProtocol.test_getitem(self)
  
      class Exc(Exception):
          pass
  
      class BadEq(object):
          def __eq__(self, other):
              raise Exc()
  
          def __hash__(self):
              return 24
  
      d = self._empty_mapping()
      d[BadEq()] = 42
      self.assertRaises(KeyError, d.__getitem__, 23)
  
      class BadHash(object):
          fail = False
  
          def __hash__(self):
              if self.fail:
                  raise Exc()
              else:
                  return 42
  
      d = self._empty_mapping()
      x = BadHash()
      d[x] = 42
      x.fail = True
      self.assertRaises(Exc, d.__getitem__, x)
  
imports: import unittest
  import collections
  from test.support import Py_C_RECURSION_LIMIT
label_desc: Use image node_id 1 for calling the TestHashMappingProtocol obj's underlying member method code with example usage: obj.test_getitem() and returns: int, int