diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-10-06 18:23:42 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-10-06 18:23:42 -0400 |
| commit | 119674dd250d7da8be92a262ad53396c2fac4e0f (patch) | |
| tree | df9b6877d6cbe101f0469eb30bd95dbacae54e54 /test/engine | |
| parent | c4dee4cbb7aa1a5486a90d3c48ffd8500d3a6dd2 (diff) | |
| download | sqlalchemy-119674dd250d7da8be92a262ad53396c2fac4e0f.tar.gz | |
- The execution options passed to an :class:`.Engine` either via
:paramref:`.create_engine.execution_options` or
:meth:`.Engine.update_execution_options` are not passed to the
special :class:`.Connection` used to initialize the dialect
within the "first connect" event; dialects will usually
perform their own queries in this phase, and none of the
current available options should be applied here. In
particular, the "autocommit" option was causing an attempt to
autocommit within this initial connect which would fail with
an AttributeError due to the non-standard state of the
:class:`.Connection`.
fixes #3200
Diffstat (limited to 'test/engine')
| -rw-r--r-- | test/engine/test_execute.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/engine/test_execute.py b/test/engine/test_execute.py index 219a145c6..a80d157ed 100644 --- a/test/engine/test_execute.py +++ b/test/engine/test_execute.py @@ -479,6 +479,14 @@ class ExecuteTest(fixtures.TestBase): eq_(canary, ["l1", "l2", "l3", "l1", "l2"]) @testing.requires.ad_hoc_engines + def test_autocommit_option_no_issue_first_connect(self): + eng = create_engine(testing.db.url) + eng.update_execution_options(autocommit=True) + conn = eng.connect() + eq_(conn._execution_options, {"autocommit": True}) + conn.close() + + @testing.requires.ad_hoc_engines def test_generative_engine_event_dispatch_hasevents(self): def l1(*arg, **kw): pass |
