MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_info

Method test_info

test/engine/test_pool.py:141–166  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

139 p.recreate()
140
141 def test_info(self):
142 p = self._queuepool_fixture(pool_size=1, max_overflow=0)
143
144 c = p.connect()
145 self.assert_(not c.info)
146 self.assert_(c.info is c._connection_record.info)
147
148 c.info["foo"] = "bar"
149 c.close()
150 del c
151
152 c = p.connect()
153 self.assert_("foo" in c.info)
154
155 c.invalidate()
156 c = p.connect()
157 self.assert_("foo" not in c.info)
158
159 c.info["foo2"] = "bar2"
160 c.detach()
161 self.assert_("foo2" in c.info)
162
163 c2 = p.connect()
164 is_not(c.dbapi_connection, c2.dbapi_connection)
165 assert not c2.info
166 assert "foo2" in c.info
167
168 def test_raw_connection_context(self):
169 p = self._queuepool_fixture(pool_size=1, max_overflow=0)

Callers

nothing calls this directly

Calls 7

is_notFunction · 0.90
_queuepool_fixtureMethod · 0.80
connectMethod · 0.45
assert_Method · 0.45
closeMethod · 0.45
invalidateMethod · 0.45
detachMethod · 0.45

Tested by

no test coverage detected