code: def test_stop_on_first_error(self):
      cur = self.conn.cursor()
      cur.execute("select 1; select x; select 1/0; select 2")
      self.assertRaises(psycopg2.errors.UndefinedColumn, self.wait, cur)
  
      cur.execute("select 1")
      self.wait(cur)
      self.assertEqual(cur.fetchone(), (1,))
  
imports: import gc
  import time
  import unittest
  import warnings
  import psycopg2
  import psycopg2.errors
  from psycopg2 import extensions
  from .testutils import ConnectingTestCase, StringIO, skip_before_postgres, skip_if_crdb, crdb_version, slow
label_desc: Use image node_id 25 for calling the AsyncTests obj's underlying member method code with example usage: obj.test_stop_on_first_error() without return types