summaryrefslogtreecommitdiff
path: root/test/dialect/test_postgresql.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2010-08-10 10:24:02 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2010-08-10 10:24:02 -0400
commita793b8e05069db9ca97b6adbb36fa1110561d30e (patch)
tree26f9a489920a1c878478b2b555cbee5a952d94c9 /test/dialect/test_postgresql.py
parent331141d936478b9d892fc51d094ef0c7e01f5d3e (diff)
downloadsqlalchemy-a793b8e05069db9ca97b6adbb36fa1110561d30e.tar.gz
- Fixed the psycopg2 dialect to use its
set_isolation_level() method instead of relying upon the base "SET SESSION ISOLATION" command, as psycopg2 resets the isolation level on each new transaction otherwise.
Diffstat (limited to 'test/dialect/test_postgresql.py')
-rw-r--r--test/dialect/test_postgresql.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/dialect/test_postgresql.py b/test/dialect/test_postgresql.py
index 86b3617ab..a605594d4 100644
--- a/test/dialect/test_postgresql.py
+++ b/test/dialect/test_postgresql.py
@@ -1325,9 +1325,23 @@ class MiscTest(TestBase, AssertsExecutionResults, AssertsCompiledSQL):
isolation_level='SERIALIZABLE')
eq_(eng.execute('show transaction isolation level').scalar(),
'serializable')
+
+ # check that it stays
+ conn = eng.connect()
+ eq_(conn.execute('show transaction isolation level').scalar(),
+ 'serializable')
+ conn.close()
+
+ conn = eng.connect()
+ eq_(conn.execute('show transaction isolation level').scalar(),
+ 'serializable')
+ conn.close()
+
eng = create_engine(testing.db.url, isolation_level='FOO')
if testing.db.driver == 'zxjdbc':
exception_cls = eng.dialect.dbapi.Error
+ elif testing.db.driver == 'psycopg2':
+ exception_cls = exc.InvalidRequestError
else:
exception_cls = eng.dialect.dbapi.ProgrammingError
assert_raises(exception_cls, eng.execute,