summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorFantix King <fantix.king@gmail.com>2020-08-31 03:41:00 -0400
committersqla-tester <sqla-tester@sqlalchemy.org>2020-08-31 03:41:00 -0400
commitcae33a79017d955c7a35bf1810c18e13fd00b4f3 (patch)
treea0309c92ffd35a58a9f013911941af5234bb2467 /test
parent575b6dded9a25fca693f0aa7f6d7c6e735490460 (diff)
downloadsqlalchemy-cae33a79017d955c7a35bf1810c18e13fd00b4f3.tar.gz
Fix AsyncEngine connect() bug when pool is exhausted
### Description Decorating the referenced `await_fallback` with `staticmethod` would stop `AsyncAdaptedQueue.await_` from being treated as a bound method. ### Checklist This pull request is: - [x] A short code fix Fixes #5546 **Have a nice day!** Closes: #5547 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5547 Pull-request-sha: 6f18ee290e7d9fe24ce2a4a4ed8069b46082ca18 Change-Id: Ie335ee650f1dee0d1fce59e448217a48307b3435
Diffstat (limited to 'test')
-rw-r--r--test/ext/asyncio/test_engine_py3k.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/ext/asyncio/test_engine_py3k.py b/test/ext/asyncio/test_engine_py3k.py
index ec513cb64..705df465b 100644
--- a/test/ext/asyncio/test_engine_py3k.py
+++ b/test/ext/asyncio/test_engine_py3k.py
@@ -1,3 +1,5 @@
+import asyncio
+
from sqlalchemy import Column
from sqlalchemy import delete
from sqlalchemy import exc
@@ -135,6 +137,16 @@ class AsyncEngineTest(EngineFixture):
trans.rollback(),
)
+ @async_test
+ async def test_pool_exhausted(self, async_engine):
+ engine = create_async_engine(
+ testing.db.url, pool_size=1, max_overflow=0, pool_timeout=0.1,
+ )
+ async with engine.connect():
+ await assert_raises_message_async(
+ asyncio.TimeoutError, "", engine.connect(),
+ )
+
class AsyncResultTest(EngineFixture):
@testing.combinations(