From: Daniele Varrazzo Date: Sat, 28 Dec 2024 00:57:02 +0000 (+0100) Subject: refactor(tests): remove Counter from utils module X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=db09c38e71f686271de60440d1bded64e4cde028;p=thirdparty%2Fpsycopg.git refactor(tests): remove Counter from utils module --- diff --git a/tests/pool/test_pool.py b/tests/pool/test_pool.py index d92859cb7..c10018ae7 100644 --- a/tests/pool/test_pool.py +++ b/tests/pool/test_pool.py @@ -7,6 +7,7 @@ import logging import weakref from time import time from typing import Any +from collections import Counter import pytest @@ -14,7 +15,7 @@ import psycopg from psycopg.pq import TransactionStatus from psycopg.rows import class_row, Row, TupleRow -from ..utils import assert_type, Counter, set_autocommit +from ..utils import assert_type, set_autocommit from ..acompat import Event, spawn, gather, sleep, skip_sync from .test_pool_common import delay_connection diff --git a/tests/pool/test_pool_async.py b/tests/pool/test_pool_async.py index 464e22ba6..a1a133444 100644 --- a/tests/pool/test_pool_async.py +++ b/tests/pool/test_pool_async.py @@ -4,6 +4,7 @@ import logging import weakref from time import time from typing import Any +from collections import Counter import pytest @@ -11,7 +12,7 @@ import psycopg from psycopg.pq import TransactionStatus from psycopg.rows import class_row, Row, TupleRow -from ..utils import assert_type, Counter, set_autocommit +from ..utils import assert_type, set_autocommit from ..acompat import AEvent, spawn, gather, asleep, skip_sync from .test_pool_common_async import delay_connection diff --git a/tests/utils.py b/tests/utils.py index 95e5ff99b..0cdba8bf3 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -3,14 +3,11 @@ from __future__ import annotations import re import sys import operator -import collections from typing import Callable from contextlib import contextmanager import pytest -Counter = collections.Counter - if sys.version_info >= (3, 11): import typing