code: def testException(self):
      success = MPI.Exception(MPI.SUCCESS)
      lasterr = MPI.Exception(MPI.ERR_LASTCODE)
      for ierr in self.errorclasses:
          errstr = MPI.Get_error_string(ierr)
          errcls = MPI.Get_error_class(ierr)
          errexc = MPI.Exception(ierr)
          self.assertEqual(errexc.error_code, ierr)
          self.assertEqual(errexc.error_class, errcls)
          self.assertEqual(errexc.error_string, errstr)
          self.assertEqual(repr(errexc), f"MPI.Exception({ierr})")
          self.assertEqual(str(errexc), errstr)
          self.assertEqual(int(errexc), ierr)
          self.assertEqual(hash(errexc), hash(errexc.error_code))
          self.assertTrue(bool(errexc == ierr))
          self.assertTrue(bool(errexc == errexc))
          self.assertFalse(bool(errexc != ierr))
          self.assertFalse(bool(errexc != errexc))
          self.assertTrue(bool(success <= ierr <= lasterr))
          self.assertTrue(bool(success <= errexc <= lasterr))
          self.assertTrue(bool(errexc >= ierr))
          self.assertTrue(bool(errexc >= success))
          self.assertTrue(bool(lasterr >= ierr))
          self.assertTrue(bool(lasterr >= errexc))
          if errexc == success:
              self.assertFalse(errexc)
          else:
              self.assertTrue(errexc)
              self.assertTrue(bool(errexc > success))
              self.assertTrue(bool(success < errexc))
      exc = MPI.Exception(MPI.SUCCESS - 1)
      self.assertEqual(exc, MPI.ERR_UNKNOWN)
      exc = MPI.Exception(MPI.ERR_LASTCODE + 1)
      self.assertEqual(exc, MPI.ERR_LASTCODE + 1)
  
file_path: mpi4py/test/test_errorcode.py
imports: from mpi4py import MPI
  import mpiunittest
label_desc: Use image node_id 3 for calling the TestErrorCode obj's underlying member method code with example usage: obj.testException() without return types