MCPcopy
hub / github.com/psycopg/psycopg / test_autocommit_inerror

Function test_autocommit_inerror

tests/test_connection.py:483–490  ·  tests/test_connection.py::test_autocommit_inerror
(conn)

Source from the content-addressed store, hash-verified

481
482
483def test_autocommit_inerror(conn):
484 cur = conn.cursor()
485 with pytest.raises(psycopg.DatabaseError):
486 cur.execute(class="st">"meh")
487 assert conn.pgconn.transaction_status == pq.TransactionStatus.INERROR
488 with pytest.raises(psycopg.ProgrammingError):
489 conn.set_autocommit(True)
490 assert not conn.autocommit
491
492
493def test_autocommit_unknown(conn):

Callers

nothing calls this directly

Calls 3

cursorMethod · 0.45
executeMethod · 0.45
set_autocommitMethod · 0.45

Tested by

no test coverage detected