MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_statement_hints

Method test_statement_hints

test/sql/test_compiler.py:3863–3878  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

3861 self.assert_compile(stmt, expected, dialect=dialect)
3862
3863 def test_statement_hints(self):
3864 stmt = (
3865 select(table1.c.myid)
3866 .with_statement_hint("test hint one")
3867 .with_statement_hint("test hint two", "mysql")
3868 )
3869
3870 self.assert_compile(
3871 stmt, "SELECT mytable.myid FROM mytable test hint one"
3872 )
3873
3874 self.assert_compile(
3875 stmt,
3876 "SELECT mytable.myid FROM mytable test hint one test hint two",
3877 dialect="mysql",
3878 )
3879
3880 def test_literal_as_text_fromstring(self):
3881 self.assert_compile(and_(text("a"), text("b")), "a AND b")

Callers

nothing calls this directly

Calls 3

selectFunction · 0.90
with_statement_hintMethod · 0.80
assert_compileMethod · 0.80

Tested by

no test coverage detected