diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-04-07 15:20:20 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-04-07 15:20:20 -0400 |
| commit | 8842bbd8b5e72796926b6e35f86d060c3b86b6a2 (patch) | |
| tree | ed7c0142f9f88b3b08346d088a310f224c87811e | |
| parent | e9d01db09b5084280660766fded8baf040b7c426 (diff) | |
| download | sqlalchemy-8842bbd8b5e72796926b6e35f86d060c3b86b6a2.tar.gz | |
- 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.
| -rw-r--r-- | test/engine/test_execute.py | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/test/engine/test_execute.py b/test/engine/test_execute.py index e83166c9a..b37c3b849 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): |
