]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
tests: don't depend on ConnDict
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Sun, 4 Feb 2024 12:07:24 +0000 (12:07 +0000)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Sun, 4 Feb 2024 14:25:43 +0000 (14:25 +0000)
Added in 3.2, so can't run the pool tests using Psycopg 3.1

tests/dbapi20.py
tests/test_psycopg_dbapi20.py

index 76b0d40339d93c0b29bc202fc6abd618ea5de3b1..ea98800f525f5de4821b83be53b1fab5e9c43c2b 100644 (file)
@@ -22,10 +22,7 @@ __author__ = 'Stuart Bishop <stuart@stuartbishop.net>'
 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
index b4feac792ab1783cb4429795b715a39f5d0d4a3d..00e37017e63d7457030bc5c022bddf848a6eccb8 100644 (file)
@@ -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