diff options
| author | Daniel Lister <dan.lister@gmail.com> | 2019-01-24 16:35:16 -0500 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2019-01-25 11:19:03 -0500 |
| commit | 2bbd3ac1fb6049fc7195821798f02ce7fa56a7e9 (patch) | |
| tree | ba97d2cda12bb1d7994ae7d58b492b6b803db208 /test/engine | |
| parent | a11a5f5af6b0c76d6f07a7ed3dd8eff7dda95ed6 (diff) | |
| download | sqlalchemy-2bbd3ac1fb6049fc7195821798f02ce7fa56a7e9.tar.gz | |
Add getters for all execution_options
Added accessors for execution options to Core and ORM, via
:meth:`.Query.get_execution_options`,
:meth:`.Connection.get_execution_options`,
:meth:`.Engine.get_execution_options`, and
:meth:`.Executable.get_execution_options`. PR courtesy Daniel Lister.
Fixes: #4406
Closes: #4465
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/4465
Pull-request-sha: 9674688bb5e80471a6a421bac06f995c2e64f8f7
Change-Id: I93ba51d7a2d687e255edd6938db15615e56dd237
Diffstat (limited to 'test/engine')
| -rw-r--r-- | test/engine/test_execute.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/engine/test_execute.py b/test/engine/test_execute.py index 061dae005..ad9144a38 100644 --- a/test/engine/test_execute.py +++ b/test/engine/test_execute.py @@ -1272,6 +1272,21 @@ class ExecutionOptionsTest(fixtures.TestBase): c2_branch = c2.connect() eq_(c2_branch._execution_options, {"foo": "bar"}) + def test_get_engine_execution_options(self): + engine = testing_engine("sqlite://") + engine.dialect = Mock() + e2 = engine.execution_options(foo="bar") + + eq_(e2.get_execution_options(), {"foo": "bar"}) + + def test_get_connection_execution_options(self): + engine = testing_engine("sqlite://", options=dict(_initialize=False)) + engine.dialect = Mock() + conn = engine.connect() + c = conn.execution_options(foo="bar") + + eq_(c.get_execution_options(), {"foo": "bar"}) + class EngineEventsTest(fixtures.TestBase): __requires__ = ("ad_hoc_engines",) |
