MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_detach_via_invalidate

Method test_detach_via_invalidate

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

Source from the content-addressed store, hash-verified

1941 eq_(c1_con.close.call_count, 1)
1942
1943 def test_detach_via_invalidate(self):
1944 dbapi, p = self._queuepool_dbapi_fixture(pool_size=1, max_overflow=0)
1945
1946 c1 = p.connect()
1947 c1_con = c1.dbapi_connection
1948 c1.invalidate()
1949 assert c1.dbapi_connection is None
1950 eq_(c1_con.close.call_count, 1)
1951
1952 c2 = p.connect()
1953 assert c2.dbapi_connection is not c1_con
1954 c2_con = c2.dbapi_connection
1955
1956 c2.close()
1957 eq_(c2_con.close.call_count, 0)
1958
1959 def test_no_double_checkin(self):
1960 p = self._queuepool_fixture(pool_size=1)

Callers

nothing calls this directly

Calls 5

eq_Function · 0.90
connectMethod · 0.45
invalidateMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected