From 721b00e7531fe61376fb0e5eb258c5ee56c9266f Mon Sep 17 00:00:00 2001 From: Federico Caselli Date: Tue, 8 Sep 2020 22:00:25 +0200 Subject: [PATCH] Fix typo in I0ad6d7a095e49d331618274c40ce75c76afdc7dd Change-Id: I649662d440f83df379922e8c967d28f635f9c85b --- lib/sqlalchemy/dialects/postgresql/pg8000.py | 4 ++-- test/dialect/postgresql/test_dialect.py | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/sqlalchemy/dialects/postgresql/pg8000.py b/lib/sqlalchemy/dialects/postgresql/pg8000.py index fd70828ff8..19570557cd 100644 --- a/lib/sqlalchemy/dialects/postgresql/pg8000.py +++ b/lib/sqlalchemy/dialects/postgresql/pg8000.py @@ -378,7 +378,7 @@ class PGDialect_pg8000(PGDialect): finally: cursor.close() - return val == "yes" + return val == "on" def set_deferrable(self, connection, value): cursor = connection.cursor() @@ -399,7 +399,7 @@ class PGDialect_pg8000(PGDialect): finally: cursor.close() - return val == "yes" + return val == "on" def set_client_encoding(self, connection, client_encoding): # adjust for ConnectionFairy possibly being present diff --git a/test/dialect/postgresql/test_dialect.py b/test/dialect/postgresql/test_dialect.py index 83bc6cac8d..13df1ce0fb 100644 --- a/test/dialect/postgresql/test_dialect.py +++ b/test/dialect/postgresql/test_dialect.py @@ -39,6 +39,7 @@ from sqlalchemy.engine import url from sqlalchemy.testing import engines from sqlalchemy.testing import fixtures from sqlalchemy.testing import is_ +from sqlalchemy.testing import is_true from sqlalchemy.testing import mock from sqlalchemy.testing.assertions import assert_raises from sqlalchemy.testing.assertions import assert_raises_message @@ -749,6 +750,7 @@ class MiscBackendTest( val = cursor.fetchone()[0] cursor.close() eq_(val, "on") + is_true(testing.db.dialect.get_readonly(dbapi_conn)) cursor = dbapi_conn.cursor() try: @@ -774,6 +776,7 @@ class MiscBackendTest( val = cursor.fetchone()[0] cursor.close() eq_(val, "on") + is_true(testing.db.dialect.get_deferrable(dbapi_conn)) cursor = dbapi_conn.cursor() try: -- 2.47.3