import unittest
import time
import sys
+from typing import Any, Dict
# Revision 1.12 2009/02/06 03:35:11 kf7xm
# The self.driver module. This should be the module where the 'connect'
# method is to be found
- driver = None
+ driver: Any = None
connect_args = () # List of arguments to pass to connect
- connect_kw_args = {} # Keyword arguments for connect
+ connect_kw_args: Dict[str, 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
self.failUnless(issubclass(self.driver.Warning,Exception))
self.failUnless(issubclass(self.driver.Error,Exception))
else:
- self.failUnless(issubclass(self.driver.Warning,StandardError))
- self.failUnless(issubclass(self.driver.Error,StandardError))
+ self.failUnless(issubclass(self.driver.Warning,StandardError)) # type: ignore[name-defined]
+ self.failUnless(issubclass(self.driver.Error,StandardError)) # type: ignore[name-defined]
self.failUnless(
issubclass(self.driver.InterfaceError,self.driver.Error)
import pytest
import datetime as dt
+from typing import Any, Dict
import psycopg
from psycopg.conninfo import conninfo_to_dict
class PsycopgTests(dbapi20.DatabaseAPI20Test):
driver = psycopg
# connect_args = () # set by the fixture
- connect_kw_args = {}
+ connect_kw_args: Dict[str, Any] = {}
def test_nextset(self):
# tested elsewhere
# Shut up warnings
-PsycopgTests.failUnless = PsycopgTests.assertTrue
+PsycopgTests.failUnless = PsycopgTests.assertTrue # type: ignore[assignment]
@pytest.mark.parametrize(
],
)
def test_connect_args(monkeypatch, pgconn, args, kwargs, want):
- the_conninfo = None
+ the_conninfo: str
def fake_connect(conninfo):
nonlocal the_conninfo