MCPcopy
hub / github.com/psycopg/psycopg / test_copy_in_error_empty

Function test_copy_in_error_empty

tests/test_copy.py:378–385  ·  view source on GitHub ↗
(conn, format)

Source from the content-addressed store, hash-verified

376
377@pytest.mark.parametrize("format", pq.Format)
378def test_copy_in_error_empty(conn, format):
379 cur = conn.cursor()
380 ensure_table(cur, sample_tabledef)
381 with pytest.raises(ZeroDivisionError, match="mannaggiamiseria"):
382 with cur.copy(f"copy copy_in from stdin (format {format.name})"):
383 raise ZeroDivisionError("mannaggiamiseria")
384
385 assert conn.info.transaction_status == pq.TransactionStatus.INERROR
386
387
388def test_copy_in_buffers_with_pg_error(conn):

Callers

nothing calls this directly

Calls 3

ensure_tableFunction · 0.70
cursorMethod · 0.45
copyMethod · 0.45

Tested by

no test coverage detected