summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/testing/assertions.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sqlalchemy/testing/assertions.py')
-rw-r--r--lib/sqlalchemy/testing/assertions.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/sqlalchemy/testing/assertions.py b/lib/sqlalchemy/testing/assertions.py
index f057ae37b..563dc2a24 100644
--- a/lib/sqlalchemy/testing/assertions.py
+++ b/lib/sqlalchemy/testing/assertions.py
@@ -340,12 +340,15 @@ class AssertsCompiledSQL(object):
result,
params=None,
checkparams=None,
+ check_literal_execute=None,
+ check_post_param=None,
dialect=None,
checkpositional=None,
check_prefetch=None,
use_default_dialect=False,
allow_dialect_select=False,
literal_binds=False,
+ render_postcompile=False,
schema_translate_map=None,
):
if use_default_dialect:
@@ -377,6 +380,9 @@ class AssertsCompiledSQL(object):
if literal_binds:
compile_kwargs["literal_binds"] = True
+ if render_postcompile:
+ compile_kwargs["render_postcompile"] = True
+
if isinstance(clause, orm.Query):
context = clause._compile_context()
context.statement.use_labels = True
@@ -418,6 +424,22 @@ class AssertsCompiledSQL(object):
eq_(tuple([p[x] for x in c.positiontup]), checkpositional)
if check_prefetch is not None:
eq_(c.prefetch, check_prefetch)
+ if check_literal_execute is not None:
+ eq_(
+ {
+ c.bind_names[b]: b.effective_value
+ for b in c.literal_execute_params
+ },
+ check_literal_execute,
+ )
+ if check_post_param is not None:
+ eq_(
+ {
+ c.bind_names[b]: b.effective_value
+ for b in c.post_compile_params
+ },
+ check_post_param,
+ )
class ComparesTables(object):