summaryrefslogtreecommitdiff
path: root/test/engine
diff options
context:
space:
mode:
authorGord Thompson <gord@gordthompson.com>2020-03-12 12:54:37 -0600
committerMike Bayer <mike_mp@zzzcomputing.com>2020-03-23 13:10:05 -0400
commit01299b6bdaf91691923a99fd8c0241dac6abc432 (patch)
tree103b6428da3a7059e138d60e601f02a7a6aa9ae7 /test/engine
parentfd74bd8eea3f3696c43ca0336ed4e437036c43c5 (diff)
downloadsqlalchemy-01299b6bdaf91691923a99fd8c0241dac6abc432.tar.gz
Implement autocommit isolation level for cx_oracle
As part of this change Oracle also gets the concept of a default isolation level, however since Oracle does not provide a fixed method of knowing what the isolation level would be without a server side transaction actually in progress, for now we hardcode just to "READ COMMITTED". Enhanced the test suite for isolation level testing in the dialect test suite and added features to requirements so that the supported isolation levels can be reported generically for dialects. Co-authored-by: Mike Bayer <mike_mp@zzzcomputing.com> Fixes: #5200 Change-Id: I2c4d49da9ff80ccc228c21e196ec9a961de53478
Diffstat (limited to 'test/engine')
-rw-r--r--test/engine/test_transaction.py29
1 files changed, 10 insertions, 19 deletions
diff --git a/test/engine/test_transaction.py b/test/engine/test_transaction.py
index c6a6c5e3a..13058fbe1 100644
--- a/test/engine/test_transaction.py
+++ b/test/engine/test_transaction.py
@@ -882,28 +882,19 @@ class IsolationLevelTest(fixtures.TestBase):
__backend__ = True
def _default_isolation_level(self):
- if testing.against("sqlite"):
- return "SERIALIZABLE"
- elif testing.against("postgresql"):
- return "READ COMMITTED"
- elif testing.against("mysql"):
- return "REPEATABLE READ"
- elif testing.against("mssql"):
- return "READ COMMITTED"
- else:
- assert False, "default isolation level not known"
+ return testing.requires.get_isolation_levels(testing.config)["default"]
def _non_default_isolation_level(self):
- if testing.against("sqlite"):
- return "READ UNCOMMITTED"
- elif testing.against("postgresql"):
- return "SERIALIZABLE"
- elif testing.against("mysql"):
- return "SERIALIZABLE"
- elif testing.against("mssql"):
- return "SERIALIZABLE"
+ levels = testing.requires.get_isolation_levels(testing.config)
+
+ default = levels["default"]
+ supported = levels["supported"]
+
+ s = set(supported).difference(["AUTOCOMMIT", default])
+ if s:
+ return s.pop()
else:
- assert False, "non default isolation level not known"
+ assert False, "no non-default isolation level available"
def test_engine_param_stays(self):