From 8bfb7a0bb46dca436201855b8907a83a3279f02c Mon Sep 17 00:00:00 2001 From: Denis Laxalde Date: Tue, 2 Nov 2021 13:40:59 +0100 Subject: [PATCH] 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. --- tests/pool/test_pool.py | 2 +- tests/pool/test_pool_async.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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) -- 2.47.3