MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_rec_info

Method test_rec_info

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

Source from the content-addressed store, hash-verified

185 eq_(p.checkedout(), 0)
186
187 def test_rec_info(self):
188 p = self._queuepool_fixture(pool_size=1, max_overflow=0)
189
190 c = p.connect()
191 self.assert_(not c.record_info)
192 self.assert_(c.record_info is c._connection_record.record_info)
193
194 c.record_info["foo"] = "bar"
195 c.close()
196 del c
197
198 c = p.connect()
199 self.assert_("foo" in c.record_info)
200
201 c.invalidate()
202 c = p.connect()
203 self.assert_("foo" in c.record_info)
204
205 c.record_info["foo2"] = "bar2"
206 c.detach()
207 is_(c.record_info, None)
208 is_(c._connection_record, None)
209
210 c2 = p.connect()
211
212 assert c2.record_info
213 assert "foo2" in c2.record_info
214
215 def test_rec_unconnected(self):
216 # test production of a _ConnectionRecord with an

Callers

nothing calls this directly

Calls 7

is_Function · 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