MCPcopy
hub / github.com/psycopg/psycopg / test_read_rows

Function test_read_rows

tests/test_copy.py:94–105  ·  view source on GitHub ↗
(conn, format, typetype)

Source from the content-addressed store, hash-verified

92@pytest.mark.parametrize("format", pq.Format)
93@pytest.mark.parametrize("typetype", ["names", "oids"])
94def test_read_rows(conn, format, typetype):
95 cur = conn.cursor()
96 with cur.copy("""
97 copy (
98 select 10::int4, 'hello'::text, '{0.0,1.0}'::float8[]
99 ) to stdout (format %s)""" % format.name) as copy:
100 copy.set_types(["int4", "text", "float8[]"])
101 row = copy.read_row()
102 assert copy.read_row() is None
103
104 assert row == (10, "hello", [0.0, 1.0])
105 assert conn.info.transaction_status == pq.TransactionStatus.INTRANS
106
107
108@pytest.mark.parametrize("format", pq.Format)

Callers

nothing calls this directly

Calls 4

set_typesMethod · 0.80
cursorMethod · 0.45
copyMethod · 0.45
read_rowMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…