| 1928 | assert c1.dbapi_connection.id != c_id |
| 1929 | |
| 1930 | def test_detach(self): |
| 1931 | dbapi, p = self._queuepool_dbapi_fixture(pool_size=1, max_overflow=0) |
| 1932 | c1 = p.connect() |
| 1933 | c1.detach() |
| 1934 | c2 = p.connect() # noqa |
| 1935 | eq_(dbapi.connect.mock_calls, [call("foo.db"), call("foo.db")]) |
| 1936 | |
| 1937 | c1_con = c1.dbapi_connection |
| 1938 | assert c1_con is not None |
| 1939 | eq_(c1_con.close.call_count, 0) |
| 1940 | c1.close() |
| 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) |