summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2017-05-23 10:17:51 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2017-05-23 15:42:06 -0400
commit1b98ce355a60b7ad9898aeb412c21591bb438231 (patch)
treeaf6a4b5a213547dd534cb4e651726db4132c20ba /test
parenta987942761542666be89f40a9ac4a35e001b8265 (diff)
downloadsqlalchemy-1b98ce355a60b7ad9898aeb412c21591bb438231.tar.gz
Remove twophase for cx_Oracle 6.x
Support for two-phase transactions has been removed entirely for cx_Oracle when version 6.0b1 or later of the DBAPI is in use. The two- phase feature historically has never been usable under cx_Oracle 5.x in any case, and cx_Oracle 6.x has removed the connection-level "twophase" flag upon which this feature relied. Change-Id: I2e8161cc2bc12f4845c9224cd483038112fe9734 Fixes: #3997
Diffstat (limited to 'test')
-rw-r--r--test/dialect/test_oracle.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/dialect/test_oracle.py b/test/dialect/test_oracle.py
index 3219a1b6d..32b39e883 100644
--- a/test/dialect/test_oracle.py
+++ b/test/dialect/test_oracle.py
@@ -17,6 +17,7 @@ from sqlalchemy.testing.engines import testing_engine
from sqlalchemy.dialects.oracle import cx_oracle, base as oracle
from sqlalchemy.engine import default
import decimal
+from sqlalchemy.engine import url
from sqlalchemy.testing.schema import Table, Column
import datetime
import os
@@ -43,6 +44,30 @@ class DialectTest(fixtures.TestBase):
(6, 0)
)
+ def test_twophase_arg(self):
+
+ mock_dbapi = Mock(version="5.0.3")
+ dialect = cx_oracle.OracleDialect_cx_oracle(dbapi=mock_dbapi)
+ args = dialect.create_connect_args(
+ url.make_url("oracle+cx_oracle://a:b@host/db"))
+
+ eq_(args[1]['twophase'], True)
+
+ mock_dbapi = Mock(version="5.0.3")
+ dialect = cx_oracle.OracleDialect_cx_oracle(
+ dbapi=mock_dbapi, allow_twophase=False)
+ args = dialect.create_connect_args(
+ url.make_url("oracle+cx_oracle://a:b@host/db"))
+
+ eq_(args[1]['twophase'], False)
+
+ mock_dbapi = Mock(version="6.0b1")
+ dialect = cx_oracle.OracleDialect_cx_oracle(dbapi=mock_dbapi)
+ args = dialect.create_connect_args(
+ url.make_url("oracle+cx_oracle://a:b@host/db"))
+
+ assert 'twophase' not in args[1]
+
class OutParamTest(fixtures.TestBase, AssertsExecutionResults):
__only_on__ = 'oracle+cx_oracle'