(self, conn)
| 157 | sql.SQL("select {a:<};").format(a=10) |
| 158 | |
| 159 | def test_must_be_adaptable(self, conn): |
| 160 | class Foo: |
| 161 | pass |
| 162 | |
| 163 | s = sql.SQL("select {0};").format(sql.Literal(Foo())) |
| 164 | with pytest.raises(ProgrammingError): |
| 165 | s.as_string(conn) |
| 166 | |
| 167 | def test_auto_literal(self, conn): |
| 168 | s = sql.SQL("select {}, {}, {}").format("he'lo", 10, dt.date(2020, 1, 1)) |