From 9c8fbe2834a601163d3a107aab7c548b3e9195f4 Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo Date: Sun, 4 Feb 2024 12:07:24 +0000 Subject: [PATCH] tests: don't depend on ConnDict Added in 3.2, so can't run the pool tests using Psycopg 3.1 --- tests/dbapi20.py | 7 ++----- tests/test_psycopg_dbapi20.py | 4 ++-- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/tests/dbapi20.py b/tests/dbapi20.py index 76b0d4033..ea98800f5 100644 --- a/tests/dbapi20.py +++ b/tests/dbapi20.py @@ -22,10 +22,7 @@ __author__ = 'Stuart Bishop ' import unittest import time import sys -from typing import Any, Dict, TYPE_CHECKING - -if TYPE_CHECKING: - from psycopg.abc import ConnDict +from typing import Any, Dict # Revision 1.12 2009/02/06 03:35:11 kf7xm @@ -106,7 +103,7 @@ class DatabaseAPI20Test(unittest.TestCase): # method is to be found driver: Any = None connect_args = () # List of arguments to pass to connect - connect_kw_args: ConnDict = {} # Keyword arguments for connect + connect_kw_args: Dict[Any, Any] = {} # Keyword arguments for connect table_prefix = 'dbapi20test_' # If you need to specify a prefix for tables ddl1 = 'create table %sbooze (name varchar(20))' % table_prefix diff --git a/tests/test_psycopg_dbapi20.py b/tests/test_psycopg_dbapi20.py index b4feac792..00e37017e 100644 --- a/tests/test_psycopg_dbapi20.py +++ b/tests/test_psycopg_dbapi20.py @@ -1,8 +1,8 @@ import pytest import datetime as dt +from typing import Any, Dict import psycopg -from psycopg.abc import ConnDict from psycopg.conninfo import conninfo_to_dict from . import dbapi20 @@ -18,7 +18,7 @@ def with_dsn(request, session_dsn): class PsycopgTests(dbapi20.DatabaseAPI20Test): driver = psycopg # connect_args = () # set by the fixture - connect_kw_args: ConnDict = {} + connect_kw_args: Dict[Any, Any] = {} def test_nextset(self): # tested elsewhere -- 2.47.3