import pytest
import psycopg
-from psycopg import pq, rows
+from psycopg import pq, rows, errors as e
from psycopg.adapt import PyFormat
from .utils import gc_collect, gc_count
def test_execute_many_results_param(conn):
cur = conn.cursor()
- with pytest.raises(psycopg.errors.SyntaxError):
+ # Postgres raises SyntaxError, CRDB raises InvalidPreparedStatementDefinition
+ with pytest.raises((e.SyntaxError, e.InvalidPreparedStatementDefinition)):
cur.execute("select %s; select generate_series(1, %s)", ("foo", 3))
import pytest
import psycopg
-from psycopg import pq, rows
+from psycopg import pq, rows, errors as e
from psycopg.adapt import PyFormat
from .utils import gc_collect, gc_count
async def test_execute_many_results_param(aconn):
cur = aconn.cursor()
- with pytest.raises(psycopg.errors.SyntaxError):
+ # Postgres raises SyntaxError, CRDB raises InvalidPreparedStatementDefinition
+ with pytest.raises((e.SyntaxError, e.InvalidPreparedStatementDefinition)):
await cur.execute("select %s; select generate_series(1, %s)", ("foo", 3))