MCPcopy
hub / github.com/psycopg/psycopg / test_copy_out_param

Function test_copy_out_param

tests/test_copy.py:81–89  ·  view source on GitHub ↗
(conn, ph, params)

Source from the content-addressed store, hash-verified

79
80@pytest.mark.parametrize("ph, params", [("%s", (10,)), ("%(n)s", {"n": 10})])
81def test_copy_out_param(conn, ph, params):
82 cur = conn.cursor()
83 with cur.copy(
84 f"copy (select * from generate_series(1, {ph})) to stdout", params
85 ) as copy:
86 copy.set_types(["int4"])
87 assert list(copy.rows()) == [(i + 1,) for i in range(10)]
88
89 assert conn.info.transaction_status == pq.TransactionStatus.INTRANS
90
91
92@pytest.mark.parametrize("format", pq.Format)

Callers

nothing calls this directly

Calls 4

set_typesMethod · 0.80
cursorMethod · 0.45
copyMethod · 0.45
rowsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…