code: def test_with_autocommit(self):
      self.conn.autocommit = True
      self.assertEqual(
          self.conn.info.transaction_status, ext.TRANSACTION_STATUS_IDLE
      )
      with self.conn:
          curs = self.conn.cursor()
          curs.execute("insert into test_with values (1)")
          self.assertEqual(
              self.conn.info.transaction_status,
              ext.TRANSACTION_STATUS_INTRANS,
          )
  
      self.assertEqual(
          self.conn.info.transaction_status, ext.TRANSACTION_STATUS_IDLE
      )
      curs.execute("select count(*) from test_with")
      self.assertEqual(curs.fetchone()[0], 1)
      self.assertEqual(
          self.conn.info.transaction_status, ext.TRANSACTION_STATUS_IDLE
      )
  
imports: import psycopg2
  import psycopg2.extensions
  import unittest
  from .testutils import ConnectingTestCase, skip_before_postgres, skip_if_crdb
label_desc: Use image node_id 9 for calling the WithConnectionTestCase obj's underlying member method code with example usage: obj.test_with_autocommit() without return types