(conn)
| 100 | |
| 101 | |
| 102 | def test_dump_cursor_ctx(conn): |
| 103 | conn.adapters.register_dumper(str, make_bin_dumper("b")) |
| 104 | conn.adapters.register_dumper(str, make_dumper("t")) |
| 105 | |
| 106 | cur = conn.cursor() |
| 107 | cur.adapters.register_dumper(str, make_bin_dumper("bc")) |
| 108 | cur.adapters.register_dumper(str, make_dumper("tc")) |
| 109 | |
| 110 | cur.execute("select %s", [MyStr("hello")]) |
| 111 | assert cur.fetchone() == ("hellotc",) |
| 112 | cur.execute("select %t", [MyStr("hello")]) |
| 113 | assert cur.fetchone() == ("hellotc",) |
| 114 | cur.execute("select %b", [MyStr("hello")]) |
| 115 | assert cur.fetchone() == ("hellobc",) |
| 116 | |
| 117 | cur = conn.cursor() |
| 118 | cur.execute("select %s", [MyStr("hello")]) |
| 119 | assert cur.fetchone() == ("hellot",) |
| 120 | cur.execute("select %t", [MyStr("hello")]) |
| 121 | assert cur.fetchone() == ("hellot",) |
| 122 | cur.execute("select %b", [MyStr("hello")]) |
| 123 | assert cur.fetchone() == ("hellob",) |
| 124 | |
| 125 | |
| 126 | def test_dump_subclass(conn): |
nothing calls this directly
no test coverage detected
searching dependent graphs…