This is to get the NotSupported raised directly when calling
tpc_prepare() as expected in test_tpc_disabled().
xid = self._tpc[0]
self._tpc = (xid, True)
yield from self._exec_command(SQL("PREPARE TRANSACTION {}").format(str(xid)))
+ if self._pipeline:
+ yield from self._pipeline._sync_gen()
def _tpc_finish_gen(self, action: str, xid: Union[Xid, str, None]) -> PQGen[None]:
fname = f"tpc_{action}()"
from psycopg.pq import TransactionStatus
-def test_tpc_disabled(conn):
+def test_tpc_disabled(conn, pipeline):
val = int(conn.execute("show max_prepared_transactions").fetchone()[0])
if val:
pytest.skip("prepared transactions enabled")
pytestmark = [pytest.mark.asyncio]
-async def test_tpc_disabled(aconn):
+async def test_tpc_disabled(aconn, apipeline):
cur = await aconn.execute("show max_prepared_transactions")
val = int((await cur.fetchone())[0])
if val: