diff options
Diffstat (limited to 'lib/sqlalchemy/testing/assertions.py')
-rw-r--r-- | lib/sqlalchemy/testing/assertions.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/sqlalchemy/testing/assertions.py b/lib/sqlalchemy/testing/assertions.py index 81c74e7c1..289ac9a0a 100644 --- a/lib/sqlalchemy/testing/assertions.py +++ b/lib/sqlalchemy/testing/assertions.py @@ -445,11 +445,9 @@ class AssertsCompiledSQL(object): from sqlalchemy import orm if isinstance(clause, orm.Query): - compile_state = clause._compile_state() - compile_state.statement._label_style = ( - LABEL_STYLE_TABLENAME_PLUS_COL - ) - clause = compile_state.statement + stmt = clause._statement_20() + stmt._label_style = LABEL_STYLE_TABLENAME_PLUS_COL + clause = stmt if compile_kwargs: kw["compile_kwargs"] = compile_kwargs |