MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / test_log_positional_array

Method test_log_positional_array

test/engine/test_logging.py:109–126  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

107 )
108
109 def test_log_positional_array(self):
110 with self.eng.begin() as conn:
111 exc_info = assert_raises(
112 tsa.exc.DBAPIError,
113 conn.execute,
114 tsa.text("SELECT * FROM foo WHERE id IN :foo AND bar=:bar"),
115 {"foo": [1, 2, 3], "bar": "hi"},
116 )
117
118 assert (
119 "[SQL: SELECT * FROM foo WHERE id IN ? AND bar=?]\n"
120 "[parameters: ([1, 2, 3], 'hi')]\n" in str(exc_info)
121 )
122
123 eq_regex(
124 self.buf.buffer[2].message,
125 r"\[generated .*\] \(\[1, 2, 3\], 'hi'\)",
126 )
127
128 def test_repr_params_positional_array(self):
129 eq_(

Callers

nothing calls this directly

Calls 3

assert_raisesFunction · 0.90
eq_regexFunction · 0.90
beginMethod · 0.45

Tested by

no test coverage detected