def test_must_be_adaptable(self): class Foo(object): pass self.assertRaises(psycopg2.ProgrammingError, sql.Literal(Foo()).as_string, self.conn)