diff options
| author | Guido van Rossum <guido@python.org> | 2015-11-19 21:33:34 (GMT) |
|---|---|---|
| committer | Guido van Rossum <guido@python.org> | 2015-11-19 21:33:34 (GMT) |
| commit | 82f9feaf1054599fdb37c6c414c7ec2e107ec2da (patch) | |
| tree | db2eeac255567196d66dbfbb8e312e6865c0eab0 /Lib/asyncio/test_utils.py | |
| parent | 557d1eb0f3ccb9b0bea685a1883dd249cbe6d23a (diff) | |
| parent | 41f69f4cc7c977bd202545b8ada01b80a278d0e2 (diff) | |
| download | cpython-82f9feaf1054599fdb37c6c414c7ec2e107ec2da.zip cpython-82f9feaf1054599fdb37c6c414c7ec2e107ec2da.tar.gz cpython-82f9feaf1054599fdb37c6c414c7ec2e107ec2da.tar.bz2 | |
Issue #25593: Change semantics of EventLoop.stop(). (Merge 3.4->3.5)
Diffstat (limited to 'Lib/asyncio/test_utils.py')
| -rw-r--r-- | Lib/asyncio/test_utils.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Lib/asyncio/test_utils.py b/Lib/asyncio/test_utils.py index 8cee95b..e06ac06 100644 --- a/Lib/asyncio/test_utils.py +++ b/Lib/asyncio/test_utils.py @@ -71,12 +71,13 @@ def run_until(loop, pred, timeout=30): def run_once(loop): - """loop.stop() schedules _raise_stop_error() - and run_forever() runs until _raise_stop_error() callback. - this wont work if test waits for some IO events, because - _raise_stop_error() runs before any of io events callbacks. + """Legacy API to run once through the event loop. + + This is the recommended pattern for test code. It will poll the + selector once and run all callbacks scheduled in response to I/O + events. """ - loop.stop() + loop.call_soon(loop.stop) loop.run_forever() |
