code: def test_async_scroll(self):
      cur = self.conn.cursor()
      cur.execute(
          """
              insert into table1 values (1);
              insert into table1 values (2);
              insert into table1 values (3);
          """
      )
      self.wait(cur)
      cur.execute("select id from table1 order by id")
  
      # scroll should fail if a query is underway
      self.assertRaises(psycopg2.ProgrammingError, cur.scroll, 1)
      self.assertTrue(self.conn.isexecuting())
  
      # but after it's done it should work
      self.wait(cur)
      cur.scroll(1)
      self.assertEquals(cur.fetchall(), [(2,), (3,)])
  
      cur = self.conn.cursor()
      cur.execute("select id from table1 order by id")
      self.wait(cur)
  
      cur2 = self.conn.cursor()
      self.assertRaises(psycopg2.ProgrammingError, cur2.scroll, 1)
  
      self.assertRaises(psycopg2.ProgrammingError, cur.scroll, 4)
  
      cur = self.conn.cursor()
      cur.execute("select id from table1 order by id")
      self.wait(cur)
      cur.scroll(2)
      cur.scroll(-1)
      self.assertEquals(cur.fetchall(), [(2,), (3,)])
  
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 16 for calling the AsyncTests obj's underlying member method code with example usage: obj.test_async_scroll() without return types