MCPcopy
hub / github.com/psycopg/psycopg / test_autocommit_intrans

Function test_autocommit_intrans

tests/test_connection.py:473–480  ·  view source on GitHub ↗
(conn)

Source from the content-addressed store, hash-verified

471
472
473def test_autocommit_intrans(conn):
474 cur = conn.cursor()
475 cur.execute("select 1")
476 assert cur.fetchone() == (1,)
477 assert conn.pgconn.transaction_status == pq.TransactionStatus.INTRANS
478 with pytest.raises(psycopg.ProgrammingError):
479 conn.set_autocommit(True)
480 assert not conn.autocommit
481
482
483def test_autocommit_inerror(conn):

Callers

nothing calls this directly

Calls 4

cursorMethod · 0.45
executeMethod · 0.45
fetchoneMethod · 0.45
set_autocommitMethod · 0.45

Tested by

no test coverage detected