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

Function test_execute

tests/test_connection_async.py:610–620  ·  view source on GitHub ↗
(aconn)

Source from the content-addressed store, hash-verified

608
609
610async def test_execute(aconn):
611 cur = await aconn.execute("select %s, %s", [10, 20])
612 assert await cur.fetchone() == (10, 20)
613 assert cur.format == 0
614 assert cur.pgresult.fformat(0) == 0
615
616 cur = await aconn.execute("select %(a)s, %(b)s", {"a": 11, "b": 21})
617 assert await cur.fetchone() == (11, 21)
618
619 cur = await aconn.execute("select 12, 22")
620 assert await cur.fetchone() == (12, 22)
621
622
623async def test_execute_binary(aconn):

Callers

nothing calls this directly

Calls 3

executeMethod · 0.45
fetchoneMethod · 0.45
fformatMethod · 0.45

Tested by

no test coverage detected