Skip to content

Commit a8c6437

Browse files
committed
Close connections properly in tests
1 parent 271e3b1 commit a8c6437

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
setuptools.setup(
1717
name='asyncpg',
18-
version='0.0.1',
18+
version='0.5.0',
1919
description='An asyncio PosgtreSQL driver',
2020
classifiers=[
2121
'License :: OSI Approved :: Apache Software License',

tests/test_connect.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,9 @@ async def test_auth_bad_user(self):
8787
loop=self.loop)
8888

8989
async def test_auth_trust(self):
90-
await self.cluster.connect(
90+
conn = await self.cluster.connect(
9191
user='trust_user', database='postgres', loop=self.loop)
92+
await conn.close()
9293

9394
async def test_auth_reject(self):
9495
with self.assertRaisesRegex(
@@ -98,9 +99,10 @@ async def test_auth_reject(self):
9899
user='reject_user', database='postgres', loop=self.loop)
99100

100101
async def test_auth_password_cleartext(self):
101-
await self.cluster.connect(
102+
conn = await self.cluster.connect(
102103
user='password_user', database='postgres',
103104
password='correctpassword', loop=self.loop)
105+
await conn.close()
104106

105107
with self.assertRaisesRegex(
106108
asyncpg.InvalidPasswordError,
@@ -110,9 +112,10 @@ async def test_auth_password_cleartext(self):
110112
password='wrongpassword', loop=self.loop)
111113

112114
async def test_auth_password_md5(self):
113-
await self.cluster.connect(
115+
conn = await self.cluster.connect(
114116
user='md5_user', database='postgres', password='correctpassword',
115117
loop=self.loop)
118+
await conn.close()
116119

117120
with self.assertRaisesRegex(
118121
asyncpg.InvalidPasswordError,

0 commit comments

Comments
 (0)