old_contents: from asyncpg import _testbase as tb
  
  
  class TestExecuteScript(tb.ConnectedTestCase):
  
      async def test_execute_script_1(self):
          r = await self.con.execute_script('''
              SELECT 1;
  
              SELECT true FROM pg_type WHERE false = true;
  
              SELECT 2;
          ''')
          self.assertIsNone(r)
  
new_contents: import asyncpg
  from asyncpg import _testbase as tb
  
  
  class TestExecuteScript(tb.ConnectedTestCase):
  
      async def test_execute_script_1(self):
          r = await self.con.execute_script('''
              SELECT 1;
  
              SELECT true FROM pg_type WHERE false = true;
  
              SELECT 2;
          ''')
          self.assertIsNone(r)
  
      async def test_execute_script_check_transactionality(self):
          with self.assertRaises(asyncpg.Error):
              await self.con.execute_script('''
                  CREATE TABLE mytab (a int);
                  SELECT * FROM mytab WHERE 1 / 0 = 1;
              ''')
  
          with self.assertRaisesRegex(asyncpg.Error, '"mytab" does not exist'):
              await self.con.prepare('''
                  SELECT * FROM mytab
              ''')
  
subject: Test execute_script transactionality