diff options
| author | Jason Kirtland <jek@discorporate.us> | 2008-08-15 23:17:24 +0000 |
|---|---|---|
| committer | Jason Kirtland <jek@discorporate.us> | 2008-08-15 23:17:24 +0000 |
| commit | 10848388a385a5619a5a626abea2e1ddf10d36d6 (patch) | |
| tree | aff35aa6e7fdd08947494cccd7fcbadbf196ef1f /lib/sqlalchemy/engine | |
| parent | 4556f4b3dfcb9d8e443042f6d61204e01c7086df (diff) | |
| download | sqlalchemy-10848388a385a5619a5a626abea2e1ddf10d36d6.tar.gz | |
- Mock engines take on the .name of their dialect. [ticket:1123]
Slightly backward incompatible: the .name is a read-only property.
The test suite was assigning .name = 'mock'; this no longer works.
Diffstat (limited to 'lib/sqlalchemy/engine')
| -rw-r--r-- | lib/sqlalchemy/engine/strategies.py | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/lib/sqlalchemy/engine/strategies.py b/lib/sqlalchemy/engine/strategies.py index c9e65982e..62a4b9bb8 100644 --- a/lib/sqlalchemy/engine/strategies.py +++ b/lib/sqlalchemy/engine/strategies.py @@ -1,20 +1,20 @@ """Strategies for creating new instances of Engine types. -These are semi-private implementation classes which -provide the underlying behavior for the "strategy" keyword argument -available on [sqlalchemy.engine#create_engine()]. -Current available options are ``plain``, ``threadlocal``, and -``mock``. - -New strategies can be added via new ``EngineStrategy`` -classes. -""" +These are semi-private implementation classes which provide the +underlying behavior for the "strategy" keyword argument available on +[sqlalchemy.engine#create_engine()]. Current available options are +``plain``, ``threadlocal``, and ``mock``. + +New strategies can be added via new ``EngineStrategy`` classes. +""" +from operator import attrgetter from sqlalchemy.engine import base, threadlocal, url from sqlalchemy import util, exc from sqlalchemy import pool as poollib + strategies = {} class EngineStrategy(object): @@ -189,7 +189,8 @@ class MockEngineStrategy(EngineStrategy): self.execute = execute engine = property(lambda s: s) - dialect = property(lambda s:s._dialect) + dialect = property(attrgetter('_dialect')) + name = property(lambda s: s._dialect.name) def contextual_connect(self, **kwargs): return self |
