From: Denis Laxalde Date: Tue, 2 Nov 2021 12:40:59 +0000 (+0100) Subject: Declare type variable for Counter in pool tests X-Git-Tag: 3.0.2~2^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8bfb7a0bb46dca436201855b8907a83a3279f02c;p=thirdparty%2Fpsycopg.git Declare type variable for Counter in pool tests We use the comment-style for type annotation because collections.Counter is generic only since Python 3.9. --- diff --git a/tests/pool/test_pool.py b/tests/pool/test_pool.py index 47a17a252..fc30c9730 100644 --- a/tests/pool/test_pool.py +++ b/tests/pool/test_pool.py @@ -818,7 +818,7 @@ def test_uniform_use(dsn, retries): for retry in retries: with retry: with pool.ConnectionPool(dsn, min_size=4) as p: - counts = Counter() + counts = Counter() # type: Counter[int] for i in range(8): with p.connection() as conn: sleep(0.1) diff --git a/tests/pool/test_pool_async.py b/tests/pool/test_pool_async.py index d2542d313..9ce51512e 100644 --- a/tests/pool/test_pool_async.py +++ b/tests/pool/test_pool_async.py @@ -812,7 +812,7 @@ async def test_uniform_use(dsn, retries): async for retry in retries: with retry: async with pool.AsyncConnectionPool(dsn, min_size=4) as p: - counts = Counter() + counts = Counter() # type: Counter[int] for i in range(8): async with p.connection() as conn: await asyncio.sleep(0.1)