summaryrefslogtreecommitdiff
path: root/test/engine/test_execute.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/engine/test_execute.py')
-rw-r--r--test/engine/test_execute.py31
1 files changed, 26 insertions, 5 deletions
diff --git a/test/engine/test_execute.py b/test/engine/test_execute.py
index e83166c9a..04d4a06d5 100644
--- a/test/engine/test_execute.py
+++ b/test/engine/test_execute.py
@@ -32,7 +32,9 @@ class ExecuteTest(TestBase):
def teardown_class(cls):
metadata.drop_all()
- @testing.fails_on_everything_except('firebird', 'maxdb', 'sqlite', '+pyodbc', '+mxodbc', '+zxjdbc', 'mysql+oursql')
+ @testing.fails_on_everything_except('firebird', 'maxdb',
+ 'sqlite', '+pyodbc',
+ '+mxodbc', '+zxjdbc', 'mysql+oursql')
def test_raw_qmark(self):
for conn in (testing.db, testing.db.connect()):
conn.execute("insert into users (user_id, user_name) values (?, ?)", (1,"jack"))
@@ -70,7 +72,8 @@ class ExecuteTest(TestBase):
# pyformat is supported for mysql, but skipping because a few driver
# versions have a bug that bombs out on this test. (1.2.2b3, 1.2.2c1, 1.2.2)
@testing.skip_if(lambda: testing.against('mysql+mysqldb'), 'db-api flaky')
- @testing.fails_on_everything_except('postgresql+psycopg2', 'postgresql+pypostgresql', 'mysql+mysqlconnector')
+ @testing.fails_on_everything_except('postgresql+psycopg2',
+ 'postgresql+pypostgresql', 'mysql+mysqlconnector')
def test_raw_python(self):
for conn in (testing.db, testing.db.connect()):
conn.execute("insert into users (user_id, user_name) values (%(id)s, %(name)s)",
@@ -117,7 +120,7 @@ class CompiledCacheTest(TestBase):
global users, metadata
metadata = MetaData(testing.db)
users = Table('users', metadata,
- Column('user_id', INT, primary_key = True),
+ Column('user_id', INT, primary_key=True, test_needs_autoincrement=True),
Column('user_name', VARCHAR(20)),
)
metadata.create_all()
@@ -269,8 +272,26 @@ class ProxyConnectionTest(TestBase):
assert_stmts(compiled, stmts)
assert_stmts(cursor, cursor_stmts)
-
- @testing.fails_on('mysql+oursql', 'oursql dialect has some extra steps here')
+
+ def test_options(self):
+ track = []
+ class TrackProxy(ConnectionProxy):
+ def __getattribute__(self, key):
+ fn = object.__getattribute__(self, key)
+ def go(*arg, **kw):
+ track.append(fn.__name__)
+ return fn(*arg, **kw)
+ return go
+ engine = engines.testing_engine(options={'proxy':TrackProxy()})
+ conn = engine.connect()
+ c2 = conn.execution_options(foo='bar')
+ eq_(c2._execution_options, {'foo':'bar'})
+ c2.execute(select([1]))
+ c3 = c2.execution_options(bar='bat')
+ eq_(c3._execution_options, {'foo':'bar', 'bar':'bat'})
+ eq_(track, ['execute', 'cursor_execute'])
+
+
def test_transactional(self):
track = []
class TrackProxy(ConnectionProxy):