def test_pq_query_badprog(query, params): pq = PostgresQuery(Transformer()) with pytest.raises(psycopg.ProgrammingError): pq.convert(query, params)
def test_pg_query_seq(query, params, want, wformats, wparams): pq = PostgresQuery(Transformer()) pq.convert(query, params) assert pq.query == want assert pq.formats == wformats assert pq.params == wparams
def test_pq_query_badtype(query, params): pq = PostgresQuery(Transformer()) with pytest.raises(TypeError): pq.convert(query, params)