]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- ah. oursql didn't have "extra steps" here, the previous system within execution_op...
authorMike Bayer <mike_mp@zzzcomputing.com>
Wed, 7 Apr 2010 19:20:20 +0000 (15:20 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 7 Apr 2010 19:20:20 +0000 (15:20 -0400)
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

index e83166c9ac04d37ab88875079059c63e056d609c..b37c3b8492feef9e33c2aadbaedde693b8cc55cb 100644 (file)
@@ -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):