diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2021-06-07 09:21:25 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2021-06-07 09:22:47 -0400 |
commit | 94169108cdd4dace09b752a6af4f4404819b49a3 (patch) | |
tree | 597ebcfd3f1875e0756f41a2af91ac112920e660 /lib/sqlalchemy/testing/assertions.py | |
parent | 0b33c250a8b78297690c74870a245aada5d5374e (diff) | |
download | sqlalchemy-94169108cdd4dace09b752a6af4f4404819b49a3.tar.gz |
init extra_criteria_entities in fromstatement w/ DML
Fixed issue in experimental "select ORM objects from INSERT/UPDATE" use
case where an error was raised if the statement were against a
single-table-inheritance subclass.
Additionally makes some adjustments in the SQL assertion
fixture to test a FromStatement w/ DML.
Fixes: #6591
Change-Id: I53a627ab18a01dc6d9b5037e28312a1177891327
Diffstat (limited to 'lib/sqlalchemy/testing/assertions.py')
-rw-r--r-- | lib/sqlalchemy/testing/assertions.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/sqlalchemy/testing/assertions.py b/lib/sqlalchemy/testing/assertions.py index b618021a6..cf61bf95c 100644 --- a/lib/sqlalchemy/testing/assertions.py +++ b/lib/sqlalchemy/testing/assertions.py @@ -487,15 +487,15 @@ class AssertsCompiledSQL(object): self.supports_execution = getattr( test_statement, "supports_execution", False ) + if self.supports_execution: self._execution_options = test_statement._execution_options - if isinstance( - test_statement, (sql.Insert, sql.Update, sql.Delete) - ): + if hasattr(test_statement, "_returning"): self._returning = test_statement._returning - if isinstance(test_statement, (sql.Insert, sql.Update)): + if hasattr(test_statement, "_inline"): self._inline = test_statement._inline + if hasattr(test_statement, "_return_defaults"): self._return_defaults = test_statement._return_defaults def _default_dialect(self): |