def test_casewhen(self): sql = ('SELECT case when val = 1 then 2 else null end as foo;\n' 'comment on table actor is \'The actor table.\';') stmts = sqlparse.split(sql) self.assertEqual(len(stmts), 2)