Lines Matching refs:loop
18 self.loop = self.new_test_loop()
36 loop = self.new_test_loop(gen)
46 loop.create_task(q.get())
53 loop.run_until_complete(add_getter())
59 loop.create_task(q.put(2))
66 loop.run_until_complete(add_putter())
110 loop = self.new_test_loop(gen)
123 t = loop.create_task(putter())
139 loop.run_until_complete(test())
140 self.assertAlmostEqual(0.02, loop.time())
152 res = self.loop.run_until_complete(queue_get())
159 waiter = self.loop.create_future()
162 res = self.loop.run_until_complete(q.get())
174 loop = self.new_test_loop(gen)
188 loop.call_later(0.01, q.put_nowait, 1)
189 queue_get_task = loop.create_task(queue_get())
196 res = loop.run_until_complete(queue_put())
198 self.assertAlmostEqual(0.01, loop.time())
218 loop = self.new_test_loop(gen)
226 get_task = loop.create_task(queue_get())
231 self.assertEqual(1, loop.run_until_complete(test()))
232 self.assertAlmostEqual(0.06, loop.time())
237 t1 = self.loop.create_task(q.get())
238 t2 = self.loop.create_task(q.get())
240 test_utils.run_briefly(self.loop)
242 test_utils.run_briefly(self.loop)
245 test_utils.run_briefly(self.loop)
250 self.loop.create_task(q.put('a'))
251 self.loop.create_task(q.put('b'))
252 test_utils.run_briefly(self.loop)
253 self.assertEqual(self.loop.run_until_complete(q.get()), 'a')
254 self.assertEqual(self.loop.run_until_complete(q.get()), 'b')
258 asyncio.set_event_loop(self.loop)
281 self.loop.run_until_complete(test())
288 self.loop = self.new_test_loop(a_generator)
297 self.loop.run_until_complete(self.loop.create_task(consumer(queue)))
310 self.loop.run_until_complete(queue_put())
319 loop = self.new_test_loop(gen)
333 loop.call_later(0.01, q.get_nowait)
334 queue_put_task = loop.create_task(queue_put())
340 loop.run_until_complete(queue_get())
341 self.assertAlmostEqual(0.01, loop.time())
353 loop = self.new_test_loop(gen)
357 reader = loop.create_task(q.get())
359 loop.run_until_complete(asyncio.sleep(0.01))
366 loop.run_until_complete(reader)
369 reader = loop.create_task(q.get())
370 loop.run_until_complete(reader)
381 loop = self.new_test_loop(gen)
382 loop.set_debug(True)
386 reader1 = loop.create_task(q.get())
387 reader2 = loop.create_task(q.get())
388 reader3 = loop.create_task(q.get())
390 loop.run_until_complete(asyncio.sleep(0.01))
397 loop.run_until_complete(reader1)
401 loop.run_until_complete(reader3)
412 loop = self.new_test_loop(gen)
419 writer = loop.create_task(q.put(2))
420 loop.run_until_complete(asyncio.sleep(0.01))
427 loop.run_until_complete(writer)
430 writer = loop.create_task(q.put(2))
431 loop.run_until_complete(writer)
455 self.loop.run_until_complete(queue_put())
467 t = self.loop.create_task(queue_put())
468 self.assertEqual(1, self.loop.run_until_complete(test()))
475 put_a = self.loop.create_task(q.put('a'))
476 put_b = self.loop.create_task(q.put('b'))
477 put_c = self.loop.create_task(q.put('X'))
479 test_utils.run_briefly(self.loop)
484 test_utils.run_briefly(self.loop)
487 test_utils.run_briefly(self.loop)
490 self.loop.run_until_complete(put_b)
494 t = self.loop.create_task(q.get())
495 test_utils.run_briefly(self.loop)
496 self.loop.run_until_complete(q.put('a'))
497 self.assertEqual(self.loop.run_until_complete(t), 'a')
501 asyncio.set_event_loop(self.loop)
508 queue = self.loop.run_until_complete(create_queue())
526 self.loop.run_until_complete(test())
533 loop = self.new_test_loop(a_generator)
540 put_task = loop.create_task(queue.put(1))
541 loop.run_until_complete(asyncio.sleep(0.01))
548 loop.run_until_complete(put_task)
556 loop = self.new_test_loop(gen)
563 put_task = loop.create_task(queue.put(1))
564 loop.run_until_complete(asyncio.sleep(0.01))
576 loop.run_until_complete(put_task)
629 tasks = [self.loop.create_task(worker())
635 tasks = self.loop.run_until_complete(test())
642 self.loop.run_until_complete(asyncio.wait(tasks))
654 self.loop.run_until_complete(join())