(self)
| 832 | del iterator |
| 833 | |
| 834 | async def test_pool_handles_asyncgen_finalization(self): |
| 835 | pool = await self.create_pool(database='postgres', |
| 836 | min_size=1, max_size=1) |
| 837 | |
| 838 | locals_ = {} |
| 839 | exec(textwrap.dedent('''\ |
| 840 | async def iterate(con): |
| 841 | for record in await con.fetch("SELECT 1"): |
| 842 | yield record |
| 843 | '''), globals(), locals_) |
| 844 | iterate = locals_['iterate'] |
| 845 | |
| 846 | class MyException(Exception): |
| 847 | pass |
| 848 | |
| 849 | with self.assertRaises(MyException): |
| 850 | async with pool.acquire() as con: |
| 851 | async with con.transaction(): |
| 852 | async for _ in iterate(con): # noqa |
| 853 | raise MyException() |
| 854 | |
| 855 | async def test_pool_close_waits_for_release(self): |
| 856 | pool = await self.create_pool(database='postgres', |
nothing calls this directly
no test coverage detected