MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_lazy_init

Method test_lazy_init

test/base/test_concurrency.py:197–214  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

195 __requires__ = ("greenlet",)
196
197 def test_lazy_init(self):
198 run = [False]
199
200 def thread_go(q):
201 def go():
202 q.get(timeout=0.1)
203
204 with expect_raises(queue.Empty):
205 asyncio.run(greenlet_spawn(go))
206 run[0] = True
207
208 t = threading.Thread(
209 target=thread_go, args=[queue.AsyncAdaptedQueue()]
210 )
211 t.start()
212 t.join()
213
214 is_true(run[0])
215
216 @async_test
217 async def test_error_other_loop(self):

Callers

nothing calls this directly

Calls 3

is_trueFunction · 0.90
startMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected