MCPcopy
hub / github.com/psycopg/psycopg / test_copy_in_buffers_pg_error

Function test_copy_in_buffers_pg_error

tests/test_copy.py:231–238  ·  view source on GitHub ↗
(conn)

Source from the content-addressed store, hash-verified

229
230
231def test_copy_in_buffers_pg_error(conn):
232 cur = conn.cursor()
233 ensure_table(cur, sample_tabledef)
234 with pytest.raises(e.UniqueViolation):
235 with cur.copy("copy copy_in from stdin (format text)") as copy:
236 copy.write(sample_text)
237 copy.write(sample_text)
238 assert conn.info.transaction_status == pq.TransactionStatus.INERROR
239
240
241def test_copy_bad_result(conn):

Callers

nothing calls this directly

Calls 4

ensure_tableFunction · 0.70
cursorMethod · 0.45
copyMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected