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

Method test_executemany_basic

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

Source from the content-addressed store, hash-verified

136 super().tearDown()
137
138 async def test_executemany_basic(self):
139 result = await self.con.executemany('''
140 INSERT INTO exmany VALUES($1, $2)
141 ''', [
142 ('a', 1), ('b', 2), ('c', 3), ('d', 4)
143 ])
144
145 self.assertIsNone(result)
146
147 result = await self.con.fetch('''
148 SELECT * FROM exmany
149 ''')
150
151 self.assertEqual(result, [
152 ('a', 1), ('b', 2), ('c', 3), ('d', 4)
153 ])
154
155 # Empty set
156 await self.con.executemany('''
157 INSERT INTO exmany VALUES($1, $2)
158 ''', ())
159
160 result = await self.con.fetch('''
161 SELECT * FROM exmany
162 ''')
163
164 self.assertEqual(result, [
165 ('a', 1), ('b', 2), ('c', 3), ('d', 4)
166 ])
167
168 async def test_executemany_returning(self):
169 result = await self.con.fetchmany('''

Callers

nothing calls this directly

Calls 2

executemanyMethod · 0.45
fetchMethod · 0.45

Tested by

no test coverage detected