MCPcopy Index your code
hub / github.com/sqlalchemy/sqlalchemy / test_timeout

Method test_timeout

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

Source from the content-addressed store, hash-verified

1090
1091 @testing.requires.timing_intensive
1092 def test_timeout(self):
1093 p = self._queuepool_fixture(pool_size=3, max_overflow=0, timeout=2)
1094 c1 = p.connect() # noqa
1095 c2 = p.connect() # noqa
1096 c3 = p.connect() # noqa
1097 now = time.time()
1098
1099 assert_raises(tsa.exc.TimeoutError, p.connect)
1100 assert int(time.time() - now) == 2
1101
1102 def test_timeout_subsecond_precision(self):
1103 """test that a subsecond precision is passed to queue.get()

Callers

nothing calls this directly

Calls 4

assert_raisesFunction · 0.90
_queuepool_fixtureMethod · 0.80
connectMethod · 0.45
timeMethod · 0.45

Tested by

no test coverage detected