Skip to content

Commit 8672b95

Browse files
author
Dmitry Shatilov
committed
Remove the trigger: default pool should work
1 parent 76a8a70 commit 8672b95

2 files changed

Lines changed: 14 additions & 9 deletions

File tree

asyncpg/pool.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1105,9 +1105,7 @@ def __await__(self):
11051105

11061106

11071107
def create_pool(dsn=None, *,
1108-
# Trigger min_size exception everywhere in the world
1109-
# to pay attention to the breaking changes
1110-
init_size=1,
1108+
init_size=10,
11111109
min_size=10,
11121110
max_size=10,
11131111
max_queries=50000,

tests/test_pool.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -804,29 +804,36 @@ async def test_pool_min_size_zero_allows_full_expiry(self):
804804

805805
async def test_pool_min_size_validation(self):
806806
# init_size < min_size should raise.
807-
with self.assertRaisesRegex(ValueError, 'init_size is smaller than min_size'):
807+
with self.assertRaisesRegex(ValueError,
808+
'init_size is smaller than min_size'):
808809
await self.create_pool(
809810
database='postgres', init_size=1, min_size=2, max_size=5)
810811

811812
# min_size > max_size should raise.
812-
with self.assertRaisesRegex(ValueError, 'min_size is greater than max_size'):
813+
with self.assertRaisesRegex(ValueError,
814+
'min_size is greater than max_size'):
813815
await self.create_pool(
814816
database='postgres', init_size=3, min_size=3, max_size=2)
815817

816818
# init_size > max_size should raise.
817-
with self.assertRaisesRegex(ValueError, 'init_size is greater than max_size'):
819+
with self.assertRaisesRegex(ValueError,
820+
'init_size is greater than max_size'):
818821
await self.create_pool(
819822
database='postgres', init_size=5, min_size=1, max_size=3)
820823

821824
# init_size < 0 should raise.
822-
with self.assertRaisesRegex(ValueError,
823-
'init_size is expected to be greater or equal to zero'):
825+
with self.assertRaisesRegex(
826+
ValueError,
827+
'init_size is expected to be greater or equal to zero'):
824828
await self.create_pool(
825829
database='postgres', init_size=-1, min_size=0, max_size=3)
826830

827831
async def test_pool_init_size_and_min_size_getters(self):
828832
async with self.create_pool(
829-
database='postgres', init_size=3, min_size=2, max_size=5) as pool:
833+
database='postgres',
834+
init_size=3,
835+
min_size=2,
836+
max_size=5) as pool:
830837
self.assertEqual(pool.get_init_size(), 3)
831838
self.assertEqual(pool.get_min_size(), 2)
832839
self.assertEqual(pool.get_max_size(), 5)

0 commit comments

Comments
 (0)