mirror of
https://github.com/python/cpython.git
synced 2025-10-17 20:28:43 +00:00
asyncio: Improve canceled timer handles cleanup. Closes issue #22448.
Patch by Joshua Moore-Oliva.
This commit is contained in:
parent
8c0e0ab767
commit
592ada9b4b
5 changed files with 159 additions and 26 deletions
|
@ -1890,9 +1890,17 @@ class HandleTests(test_utils.TestCase):
|
|||
|
||||
# cancelled handle
|
||||
h.cancel()
|
||||
self.assertEqual(repr(h),
|
||||
'<Handle cancelled noop(1, 2) at %s:%s created at %s:%s>'
|
||||
% (filename, lineno, create_filename, create_lineno))
|
||||
self.assertEqual(
|
||||
repr(h),
|
||||
'<Handle cancelled noop(1, 2) at %s:%s created at %s:%s>'
|
||||
% (filename, lineno, create_filename, create_lineno))
|
||||
|
||||
# double cancellation won't overwrite _repr
|
||||
h.cancel()
|
||||
self.assertEqual(
|
||||
repr(h),
|
||||
'<Handle cancelled noop(1, 2) at %s:%s created at %s:%s>'
|
||||
% (filename, lineno, create_filename, create_lineno))
|
||||
|
||||
def test_handle_source_traceback(self):
|
||||
loop = asyncio.get_event_loop_policy().new_event_loop()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue