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

Method test_reconnect

test/engine/test_pool.py:1914–1930  ·  view source on GitHub ↗

tests reconnect operations at the pool level. SA's engine/dialect includes another layer of reconnect support for 'database was lost' errors.

(self)

Source from the content-addressed store, hash-verified

1912 assert p2._max_overflow == 0
1913
1914 def test_reconnect(self):
1915 """tests reconnect operations at the pool level. SA's
1916 engine/dialect includes another layer of reconnect support for
1917 'database was lost' errors."""
1918
1919 dbapi, p = self._queuepool_dbapi_fixture(pool_size=1, max_overflow=0)
1920 c1 = p.connect()
1921 c_id = c1.dbapi_connection.id
1922 c1.close()
1923 c1 = None
1924 c1 = p.connect()
1925 assert c1.dbapi_connection.id == c_id
1926 dbapi.raise_error = True
1927 c1.invalidate()
1928 c1 = None
1929 c1 = p.connect()
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)

Callers

nothing calls this directly

Calls 4

connectMethod · 0.45
closeMethod · 0.45
invalidateMethod · 0.45

Tested by

no test coverage detected