From 8842bbd8b5e72796926b6e35f86d060c3b86b6a2 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Wed, 7 Apr 2010 15:20:20 -0400 Subject: [PATCH] - ah. oursql didn't have "extra steps" here, the previous system within execution_options() used by oursql would generate a proxied connection from within the dialect.initialize() phase. the new clone system bypasses that. --- test/engine/test_execute.py | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/test/engine/test_execute.py b/test/engine/test_execute.py index e83166c9ac..b37c3b8492 100644 --- a/test/engine/test_execute.py +++ b/test/engine/test_execute.py @@ -269,8 +269,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): -- 2.47.3