MCPcopy
hub / github.com/psycopg/psycopg / test_connect_context_copy

Function test_connect_context_copy

tests/test_connection_async.py:892–902  ·  view source on GitHub ↗
(aconn_cls, dsn, aconn)

Source from the content-addressed store, hash-verified

890
891
892async def test_connect_context_copy(aconn_cls, dsn, aconn):
893 aconn.adapters.register_dumper(str, make_bin_dumper("b"))
894 aconn.adapters.register_dumper(str, make_dumper("t"))
895
896 conn2 = await aconn_cls.connect(dsn, context=aconn)
897
898 cur = await conn2.execute("select %s", ["hello"])
899 assert (await cur.fetchone())[0] == "hellot"
900 cur = await conn2.execute("select %b", ["hello"])
901 assert (await cur.fetchone())[0] == "hellob"
902 await conn2.close()
903
904
905async def test_cancel_closed(aconn):

Callers

nothing calls this directly

Calls 7

make_bin_dumperFunction · 0.85
make_dumperFunction · 0.85
register_dumperMethod · 0.80
connectMethod · 0.45
executeMethod · 0.45
fetchoneMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…