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

Method test_detach

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

Source from the content-addressed store, hash-verified

1930 assert c1.dbapi_connection.id != c_id
1931
1932 def test_detach(self):
1933 dbapi, p = self._queuepool_dbapi_fixture(pool_size=1, max_overflow=0)
1934 c1 = p.connect()
1935 c1.detach()
1936 c2 = p.connect() # noqa
1937 eq_(dbapi.connect.mock_calls, [call("foo.db"), call("foo.db")])
1938
1939 c1_con = c1.dbapi_connection
1940 assert c1_con is not None
1941 eq_(c1_con.close.call_count, 0)
1942 c1.close()
1943 eq_(c1_con.close.call_count, 1)
1944
1945 def test_detach_via_invalidate(self):
1946 dbapi, p = self._queuepool_dbapi_fixture(pool_size=1, max_overflow=0)

Callers

nothing calls this directly

Calls 5

eq_Function · 0.90
connectMethod · 0.45
detachMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected