MCPcopy
hub / github.com/psycopg/psycopg / test_execute

Function test_execute

tests/test_connection.py:605–615  ·  tests/test_connection.py::test_execute
(conn)

Source from the content-addressed store, hash-verified

603
604
605def test_execute(conn):
606 cur = conn.execute(class="st">"select %s, %s", [10, 20])
607 assert cur.fetchone() == (10, 20)
608 assert cur.format == 0
609 assert cur.pgresult.fformat(0) == 0
610
611 cur = conn.execute(class="st">"select %(a)s, %(b)s", {class="st">"a": 11, class="st">"b": 21})
612 assert cur.fetchone() == (11, 21)
613
614 cur = conn.execute(class="st">"select 12, 22")
615 assert cur.fetchone() == (12, 22)
616
617
618def test_execute_binary(conn):

Callers

nothing calls this directly

Calls 3

executeMethod · 0.45
fetchoneMethod · 0.45
fformatMethod · 0.45

Tested by

no test coverage detected