MCPcopy Create free account
hub / github.com/MagicStack/asyncpg / test_execute_script_2

Method test_execute_script_2

tests/test_execute.py:29–41  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

27 self.assertEqual(status, 'SELECT 10')
28
29 async def test_execute_script_2(self):
30 status = await self.con.execute('''
31 CREATE TABLE mytab (a int);
32 ''')
33 self.assertEqual(status, 'CREATE TABLE')
34
35 try:
36 status = await self.con.execute('''
37 INSERT INTO mytab (a) VALUES ($1), ($2)
38 ''', 10, 20)
39 self.assertEqual(status, 'INSERT 0 2')
40 finally:
41 await self.con.execute('DROP TABLE mytab')
42
43 async def test_execute_script_3(self):
44 with self.assertRaisesRegex(asyncpg.PostgresSyntaxError,

Callers

nothing calls this directly

Calls 1

executeMethod · 0.45

Tested by

no test coverage detected