From aa026c302c6b188a7e28508f9ecb603809b9e03f Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sat, 30 Oct 2021 14:44:55 -0400 Subject: 2.0 removals: LegacyRow, connectionless execution, close_with_result in order to remove LegacyRow / LegacyResult, we have to also lose close_with_result, which connectionless execution relies upon. also includes a new profiles.txt file that's all against py310, as that's what CI is on now. some result counts changed by one function call which was enough to fail the low-count result tests. Replaces Connectable as the common interface between Connection and Engine with EngineEventsTarget. Engine is no longer Connectable. Connection and MockConnection still are. References: #7257 Change-Id: Iad5eba0313836d347e65490349a22b061356896a --- lib/sqlalchemy/engine/mock.py | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) (limited to 'lib/sqlalchemy/engine/mock.py') diff --git a/lib/sqlalchemy/engine/mock.py b/lib/sqlalchemy/engine/mock.py index 803fe30a2..5da716b6b 100644 --- a/lib/sqlalchemy/engine/mock.py +++ b/lib/sqlalchemy/engine/mock.py @@ -10,7 +10,6 @@ from operator import attrgetter from . import base from . import url as _url from .. import util -from ..sql import ddl class MockConnection(base.Connectable): @@ -22,32 +21,15 @@ class MockConnection(base.Connectable): dialect = property(attrgetter("_dialect")) name = property(lambda s: s._dialect.name) - def schema_for_object(self, obj): - return obj.schema - def connect(self, **kwargs): return self + def schema_for_object(self, obj): + return obj.schema + def execution_options(self, **kw): return self - def compiler(self, statement, parameters, **kwargs): - return self._dialect.compiler( - statement, parameters, engine=self, **kwargs - ) - - def create(self, entity, **kwargs): - kwargs["checkfirst"] = False - - ddl.SchemaGenerator(self.dialect, self, **kwargs).traverse_single( - entity - ) - - def drop(self, entity, **kwargs): - kwargs["checkfirst"] = False - - ddl.SchemaDropper(self.dialect, self, **kwargs).traverse_single(entity) - def _run_ddl_visitor( self, visitorcallable, element, connection=None, **kwargs ): -- cgit v1.2.1