diff options
author | Federico Caselli <cfederico87@gmail.com> | 2022-09-15 22:42:08 +0200 |
---|---|---|
committer | Federico Caselli <cfederico87@gmail.com> | 2022-09-15 22:42:08 +0200 |
commit | 20917c591848792932dfebbe6580276a885385a5 (patch) | |
tree | f10a929948d7a782c9b097b17c7158c0ea466802 /test/engine/test_pool.py | |
parent | de173b600b0d3747bcf1941e3027598c66da33ac (diff) | |
download | sqlalchemy-20917c591848792932dfebbe6580276a885385a5.tar.gz |
Ignore max_overflow when pool_size is 0
The :class:`_pool.QueuePool` now ignores ``max_overflow`` when
``pool_size=0``, properly making the pool unlimited in all cases.
Fixes: #8523
Change-Id: Ifc32eb47a281c4b3acf357352f07b9b8a73d1b6f
Diffstat (limited to 'test/engine/test_pool.py')
-rw-r--r-- | test/engine/test_pool.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/engine/test_pool.py b/test/engine/test_pool.py index 39f86e280..f28da14be 100644 --- a/test/engine/test_pool.py +++ b/test/engine/test_pool.py @@ -1373,6 +1373,16 @@ class QueuePoolTest(PoolTestBase): def test_max_overflow(self): self._test_overflow(40, 5) + @testing.combinations(42, 0, -5, 1) + def test_unlimited(self, max_overflow): + p = self._queuepool_fixture(pool_size=0, max_overflow=max_overflow) + eq_(p.overflow(), 0) + c1 = p.connect() + c2 = p.connect() + eq_(p.overflow(), 0) + c1.close() + c2.close() + def test_overflow_no_gc(self): p = self._queuepool_fixture(pool_size=2, max_overflow=2) |