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

Method test_timeout

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

Source from the content-addressed store, hash-verified

1092
1093 @testing.requires.timing_intensive
1094 def test_timeout(self):
1095 p = self._queuepool_fixture(pool_size=3, max_overflow=0, timeout=2)
1096 c1 = p.connect() # noqa
1097 c2 = p.connect() # noqa
1098 c3 = p.connect() # noqa
1099 now = time.time()
1100
1101 assert_raises(tsa.exc.TimeoutError, p.connect)
1102 assert int(time.time() - now) == 2
1103
1104 def test_timeout_subsecond_precision(self):
1105 """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