diff options
author | Wolfgang E. Sanyer <WolfgangESanyer@gmail.com> | 2021-09-17 17:04:59 -0400 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2021-09-19 20:57:12 -0700 |
commit | 3812225ace5db8c691cbe027d234a3e223972199 (patch) | |
tree | 393971cca00076ab902f2b6f6351394b50639c06 /lib/portage/tests/util/futures/test_done_callback_after_exit.py | |
parent | Include INHERIT value in generated cache (diff) | |
download | portage-3812225ace5db8c691cbe027d234a3e223972199.tar.gz portage-3812225ace5db8c691cbe027d234a3e223972199.tar.bz2 portage-3812225ace5db8c691cbe027d234a3e223972199.zip |
Reformat to use spaces instead of tabs. Also, use black
The following command was used to reformat:
autopep8 --in-place --select=E101,E11,E121,E122,E123,E124,E125,E126,E127,E128,E129,E131,E133,E20,E211,E22,E224,E224,E226,E227,E228,E231,E241,E242,E251,E252,E26,E265,E266,E27,E301,E302,E303,E304,E305,E306,W291,W293,W391 -r .
black was run as `black .`, using the default configurations
Signed-off-by: Wolfgang E. Sanyer <WolfgangESanyer@gmail.com>
Signed-off-by: Zac Medico <zmedico@gentoo.org>
Diffstat (limited to 'lib/portage/tests/util/futures/test_done_callback_after_exit.py')
-rw-r--r-- | lib/portage/tests/util/futures/test_done_callback_after_exit.py | 69 |
1 files changed, 34 insertions, 35 deletions
diff --git a/lib/portage/tests/util/futures/test_done_callback_after_exit.py b/lib/portage/tests/util/futures/test_done_callback_after_exit.py index 7ac7674e6..67e28b2ab 100644 --- a/lib/portage/tests/util/futures/test_done_callback_after_exit.py +++ b/lib/portage/tests/util/futures/test_done_callback_after_exit.py @@ -7,38 +7,37 @@ from portage.util.futures import asyncio class DoneCallbackAfterExitTestCase(TestCase): - - def test_done_callback_after_exit(self): - """ - Test that callbacks can be registered via the Future - add_done_callback method even after the future is done, and - verify that the callbacks are called. - """ - loop = asyncio._wrap_loop() - future = loop.create_future() - future.set_result(None) - - for i in range(3): - event = loop.create_future() - future.add_done_callback(lambda future: event.set_result(None)) - loop.run_until_complete(event) - - def test_exit_listener_after_exit(self): - """ - Test that callbacks can be registered via the AsynchronousTask - addExitListener method even after the task is done, and - verify that the callbacks are called. - """ - loop = asyncio._wrap_loop() - task = AsynchronousTask(scheduler=loop) - task.start() - loop.run_until_complete(task.async_wait()) - - for i in range(3): - event = loop.create_future() - task.addStartListener(lambda task: event.set_result(None)) - loop.run_until_complete(event) - - event = loop.create_future() - task.addExitListener(lambda task: event.set_result(None)) - loop.run_until_complete(event) + def test_done_callback_after_exit(self): + """ + Test that callbacks can be registered via the Future + add_done_callback method even after the future is done, and + verify that the callbacks are called. + """ + loop = asyncio._wrap_loop() + future = loop.create_future() + future.set_result(None) + + for i in range(3): + event = loop.create_future() + future.add_done_callback(lambda future: event.set_result(None)) + loop.run_until_complete(event) + + def test_exit_listener_after_exit(self): + """ + Test that callbacks can be registered via the AsynchronousTask + addExitListener method even after the task is done, and + verify that the callbacks are called. + """ + loop = asyncio._wrap_loop() + task = AsynchronousTask(scheduler=loop) + task.start() + loop.run_until_complete(task.async_wait()) + + for i in range(3): + event = loop.create_future() + task.addStartListener(lambda task: event.set_result(None)) + loop.run_until_complete(event) + + event = loop.create_future() + task.addExitListener(lambda task: event.set_result(None)) + loop.run_until_complete(event) |