code: def test_exception_class(self):
      cur = self.conn.cursor()
      try:
          cur.execute("select * from nonexist")
      except psycopg2.Error as exc:
          e = exc
  
      self.assert_(isinstance(e, UndefinedTable), type(e))
      self.assert_(isinstance(e, self.conn.ProgrammingError))
  
file_path: psycopg2/tests/test_errors.py
imports: import unittest
  from .testutils import ConnectingTestCase
  import psycopg2
  from psycopg2 import errors
  from psycopg2._psycopg import sqlstate_errors
  from psycopg2.errors import UndefinedTable
label_desc: Use image node_id 1 for calling the ErrorsTests obj's underlying member method code with example usage: obj.test_exception_class() without return types