]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
Add required type variable to (Async)Connection in pool tests
authorDenis Laxalde <denis.laxalde@dalibo.com>
Tue, 2 Nov 2021 12:39:30 +0000 (13:39 +0100)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Wed, 3 Nov 2021 15:55:14 +0000 (16:55 +0100)
tests/pool/test_pool.py
tests/pool/test_pool_async.py

index 9931fb765c6e1908873169bc92ca44b103a52da2..416b9bde0d79e422d9241ef1ee41b99bd35d4e3e 100644 (file)
@@ -4,6 +4,7 @@ import weakref
 from time import sleep, time
 from threading import Thread, Event
 from collections import Counter
+from typing import Any
 
 import pytest
 
@@ -52,7 +53,7 @@ def test_min_size_max_size(dsn):
 
 
 def test_connection_class(dsn):
-    class MyConn(psycopg.Connection):
+    class MyConn(psycopg.Connection[Any]):
         pass
 
     with pool.ConnectionPool(dsn, connection_class=MyConn, min_size=1) as p:
index e8593946ff521b09a235cdd8f1f571dcb6be308b..58abfd5dd4f50230d6f6d39667f5ea3e7cf92605 100644 (file)
@@ -3,6 +3,7 @@ import asyncio
 import logging
 from time import time
 from collections import Counter
+from typing import Any
 
 import pytest
 
@@ -48,7 +49,7 @@ async def test_min_size_max_size(dsn):
 
 
 async def test_connection_class(dsn):
-    class MyConn(psycopg.AsyncConnection):
+    class MyConn(psycopg.AsyncConnection[Any]):
         pass
 
     async with pool.AsyncConnectionPool(