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

Function test_connect_context_copy

tests/test_connection.py:875–885  ·  view source on GitHub ↗
(conn_cls, dsn, conn)

Source from the content-addressed store, hash-verified

873
874
875def test_connect_context_copy(conn_cls, dsn, conn):
876 conn.adapters.register_dumper(str, make_bin_dumper("b"))
877 conn.adapters.register_dumper(str, make_dumper("t"))
878
879 conn2 = conn_cls.connect(dsn, context=conn)
880
881 cur = conn2.execute("select %s", ["hello"])
882 assert cur.fetchone()[0] == "hellot"
883 cur = conn2.execute("select %b", ["hello"])
884 assert cur.fetchone()[0] == "hellob"
885 conn2.close()
886
887
888def test_cancel_closed(conn):

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…