MCPcopy
hub / github.com/psycopg/psycopg / test_as_bytes_context

Function test_as_bytes_context

tests/test_sql.py:664–668  ·  view source on GitHub ↗
(conn)

Source from the content-addressed store, hash-verified

662
663
664def test_as_bytes_context(conn):
665 conn.adapters.register_dumper(str, make_dumper("1"))
666 query = sql.as_bytes(sql.SQL("select {}").format("foo"), context=conn)
667 assert isinstance(query, bytes)
668 assert query == no_e(b"select 'foo1'")
669
670
671def test_as_bytes_literal():

Callers

nothing calls this directly

Calls 5

make_dumperFunction · 0.85
no_eFunction · 0.85
register_dumperMethod · 0.80
formatMethod · 0.80
as_bytesMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…