From fa858737eaac7e9be7dfc50853b2e54f16d6c50f Mon Sep 17 00:00:00 2001 From: Zeke Brechtel <5767468+zkl2@users.noreply.github.com> Date: Sat, 25 Sep 2021 07:49:32 -0600 Subject: [PATCH] fixing pre-commit issues --- test/dialect/postgresql/test_dialect.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) 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" -- 2.47.3