Skip to content

Commit 6d26533

Browse files
committed
Point Engine.dialect to Connection.dialect
1 parent 2df89ca commit 6d26533

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

transactions/fixtures.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,18 @@ def _engine(pytestconfig, request, _transaction, mocker):
7070
'''
7171
connection, _, session = _transaction
7272

73-
# Make sure that any attempts to call `connect()` simply returns a
73+
# Make sure that any attempts to call `connect()` simply return a
7474
# reference to the open connection
7575
engine = mocker.MagicMock(spec=sa.engine.Engine)
7676

7777
engine.connect.return_value = connection
7878
engine.contextual_connect.return_value = connection
7979

80+
# References to `Engine.dialect` should redirect to the Connection (this
81+
# is primarily useful for the `autoload` flag in SQLAlchemy, which references
82+
# the Engine dialect to reflect tables)
83+
engine.dialect = connection.dialect
84+
8085
@contextlib.contextmanager
8186
def begin():
8287
'''

0 commit comments

Comments
 (0)