From: Zeke Brechtel <5767468+zkl2@users.noreply.github.com> Date: Sat, 25 Sep 2021 13:49:32 +0000 (-0600) Subject: fixing pre-commit issues X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fa858737eaac7e9be7dfc50853b2e54f16d6c50f;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git fixing pre-commit issues --- diff --git a/test/dialect/postgresql/test_dialect.py b/test/dialect/postgresql/test_dialect.py index 9650eaed5c..9ee00198ca 100644 --- a/test/dialect/postgresql/test_dialect.py +++ b/test/dialect/postgresql/test_dialect.py @@ -256,16 +256,14 @@ $$ LANGUAGE plpgsql;""" eq_(cparams["host"], "hostA:portA,hostB,hostC") def test_psycopg2_disconnect(self): - class Error(Exception): pass dbapi = mock.Mock() dbapi.Error = Error - # dialect = getattr(pscyopg2_dialect, dialect_name).dialect(dbapi=dbapi) dialect = psycopg2_dialect.dialect(dbapi=dbapi) - + for error in [ # these error messages from libpq: interfaces/libpq/fe-misc.c # and interfaces/libpq/fe-secure.c. @@ -286,14 +284,11 @@ $$ LANGUAGE plpgsql;""" "SSL SYSCALL error: Operation timed out", "SSL SYSCALL error: Bad address", ]: - eq_(dialect.is_disconnect( - Error(error), - None, None), True) + eq_(dialect.is_disconnect(Error(error), None, None), True) eq_(dialect.is_disconnect("not an error", None, None), False) - class PGCodeTest(fixtures.TestBase): __only_on__ = "postgresql"