| 241 | self.assertEqual(len(self.con._stmts_to_close), 1) |
| 242 | |
| 243 | async def test_prepare_13_connect(self): |
| 244 | v = await self.con.fetchval( |
| 245 | 'SELECT $1::smallint AS foo', 10, column='foo') |
| 246 | self.assertEqual(v, 10) |
| 247 | |
| 248 | r = await self.con.fetchrow('SELECT $1::smallint * 2 AS test', 10) |
| 249 | self.assertEqual(r['test'], 20) |
| 250 | |
| 251 | rows = await self.con.fetch('SELECT generate_series(0,$1::int)', 3) |
| 252 | self.assertEqual([r[0] for r in rows], [0, 1, 2, 3]) |
| 253 | |
| 254 | async def test_prepare_14_explain(self): |
| 255 | # Test simple EXPLAIN. |