Skip to content

Commit be85419

Browse files
euri10cofin
authored andcommitted
close the pool
1 parent a4f4462 commit be85419

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
__all__ = ("test_manual_pool",)
22

33

4-
def test_manual_pool() -> None:
4+
async def test_manual_pool() -> None:
55

66
# start-example
77
import os
@@ -10,9 +10,10 @@ def test_manual_pool() -> None:
1010

1111
from sqlspec.adapters.asyncpg import AsyncpgConfig
1212

13-
pool = asyncpg.create_pool(
13+
pool = await asyncpg.create_pool(
1414
dsn=os.getenv("SQLSPEC_USAGE_PG_DSN", "postgresql://localhost/db"), min_size=10, max_size=20
1515
)
1616
db = AsyncpgConfig(pool_instance=pool)
1717
# end-example
1818
assert db.pool_instance is pool
19+
await pool.close()

0 commit comments

Comments
 (0)