From fe591913030a244a9ccfdd47b371609f1f1b44af Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Thu, 9 Apr 2020 18:03:30 -0400 Subject: Modernize test_defaults Use modern execution patterns, goal is so that these same tests can work for the future engine break sequence tests into test_sequences suite sequence tests that are testing implicit execution patterns at least move into their own suite that will go into test_deprecations eventually. Change-Id: I27cac9bd265c86ff2a3381ff9f844f60ef991cfc --- lib/sqlalchemy/sql/schema.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'lib/sqlalchemy/sql/schema.py') diff --git a/lib/sqlalchemy/sql/schema.py b/lib/sqlalchemy/sql/schema.py index 5c6b1f3c6..eb6c12f80 100644 --- a/lib/sqlalchemy/sql/schema.py +++ b/lib/sqlalchemy/sql/schema.py @@ -2100,10 +2100,17 @@ class DefaultGenerator(SchemaItem): else: self.column.default = self + @util.deprecated_20( + ":meth:`.DefaultGenerator.execute`", + alternative="All statement execution in SQLAlchemy 2.0 is performed " + "by the :meth:`.Connection.execute` method of :class:`.Connection`, " + "or in the ORM by the :meth:`.Session.execute` method of " + ":class:`.Session`.", + ) def execute(self, bind=None, **kwargs): if bind is None: bind = _bind_or_error(self) - return bind._execute_default(self, **kwargs) + return bind.execute(self, **kwargs) def _execute_on_connection(self, connection, multiparams, params): return connection._execute_default(self, multiparams, params) -- cgit v1.2.1