MCPcopy
hub / github.com/psycopg/psycopg / test_dump_connection_ctx

Function test_dump_connection_ctx

tests/test_adapt.py:89–99  ·  view source on GitHub ↗
(conn)

Source from the content-addressed store, hash-verified

87
88
89def test_dump_connection_ctx(conn):
90 conn.adapters.register_dumper(MyStr, make_bin_dumper("b"))
91 conn.adapters.register_dumper(MyStr, make_dumper("t"))
92
93 cur = conn.cursor()
94 cur.execute("select %s", [MyStr("hello")])
95 assert cur.fetchone() == ("hellot",)
96 cur.execute("select %t", [MyStr("hello")])
97 assert cur.fetchone() == ("hellot",)
98 cur.execute("select %b", [MyStr("hello")])
99 assert cur.fetchone() == ("hellob",)
100
101
102def test_dump_cursor_ctx(conn):

Callers

nothing calls this directly

Calls 7

make_bin_dumperFunction · 0.85
make_dumperFunction · 0.85
MyStrClass · 0.85
register_dumperMethod · 0.80
cursorMethod · 0.45
executeMethod · 0.45
fetchoneMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…