From: Daniele Varrazzo Date: Mon, 8 Nov 2021 14:43:39 +0000 (+0100) Subject: Add type annotations to two-phase commit tests X-Git-Tag: pool-3.1~102^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fb0d2a1c95c89d0e72adbe788568f723c29d4de7;p=thirdparty%2Fpsycopg.git Add type annotations to two-phase commit tests --- diff --git a/tests/dbapi20_tpc.py b/tests/dbapi20_tpc.py index d68703282..5026a6124 100644 --- a/tests/dbapi20_tpc.py +++ b/tests/dbapi20_tpc.py @@ -6,11 +6,12 @@ """ import unittest +from typing import Any class TwoPhaseCommitTests(unittest.TestCase): - driver = None + driver: Any = None def connect(self): """Make a database connection.""" diff --git a/tests/test_psycopg_dbapi20.py b/tests/test_psycopg_dbapi20.py index 4aa1cc7c7..9c900c015 100644 --- a/tests/test_psycopg_dbapi20.py +++ b/tests/test_psycopg_dbapi20.py @@ -33,7 +33,7 @@ class PsycopgTests(dbapi20.DatabaseAPI20Test): @pytest.mark.usefixtures("with_dsn") class PsycopgTPCTests(dbapi20_tpc.TwoPhaseCommitTests): driver = psycopg - # connect_args = () # set by the fixture + connect_args = () # set by the fixture def connect(self): return psycopg.connect(*self.connect_args) @@ -41,7 +41,9 @@ class PsycopgTPCTests(dbapi20_tpc.TwoPhaseCommitTests): # Shut up warnings PsycopgTests.failUnless = PsycopgTests.assertTrue # type: ignore[assignment] -PsycopgTPCTests.assertEquals = PsycopgTPCTests.assertEqual +PsycopgTPCTests.assertEquals = ( # type: ignore[assignment] + PsycopgTPCTests.assertEqual +) @pytest.mark.parametrize(