changeset: 91414:e9150fdf068a branch: 3.4 parent: 91412:1088023d971c user: Victor Stinner date: Wed Jun 25 23:32:25 2014 +0200 files: Lib/test/test_asyncio/test_base_events.py Lib/test/test_asyncio/test_tasks.py description: asyncio: sync with Tulip - Python issue 21163: Fix more "Task was destroyed but it is pending!" logs in tests - Add test to check that run_until_complete() checks the loop of the future diff -r 1088023d971c -r e9150fdf068a Lib/test/test_asyncio/test_base_events.py --- a/Lib/test/test_asyncio/test_base_events.py Wed Jun 25 23:11:21 2014 +0200 +++ b/Lib/test/test_asyncio/test_base_events.py Wed Jun 25 23:32:25 2014 +0200 @@ -288,6 +288,12 @@ self.assertRaises(TypeError, self.loop.run_until_complete, 'blah') + def test_run_until_complete_loop(self): + task = asyncio.Future(loop=self.loop) + other_loop = self.new_test_loop() + self.assertRaises(ValueError, + other_loop.run_until_complete, task) + def test_subprocess_exec_invalid_args(self): args = [sys.executable, '-c', 'pass'] diff -r 1088023d971c -r e9150fdf068a Lib/test/test_asyncio/test_tasks.py --- a/Lib/test/test_asyncio/test_tasks.py Wed Jun 25 23:11:21 2014 +0200 +++ b/Lib/test/test_asyncio/test_tasks.py Wed Jun 25 23:32:25 2014 +0200 @@ -51,6 +51,7 @@ self.set_event_loop(loop) t = asyncio.Task(notmuch(), loop=loop) self.assertIs(t._loop, loop) + loop.run_until_complete(t) loop.close() def test_async_coroutine(self): @@ -67,6 +68,7 @@ self.set_event_loop(loop) t = asyncio.async(notmuch(), loop=loop) self.assertIs(t._loop, loop) + loop.run_until_complete(t) loop.close() def test_async_future(self): @@ -213,6 +215,7 @@ t.add_done_callback(Dummy()) self.assertEqual(repr(t), '()]>' % coro) + self.loop.run_until_complete(t) def test_task_basics(self): @asyncio.coroutine