diff options
author | Yury Selivanov <yselivanov@sprymix.com> | 2014-09-25 12:07:56 -0400 |
---|---|---|
committer | Yury Selivanov <yselivanov@sprymix.com> | 2014-09-25 12:07:56 -0400 |
commit | 592ada9b4b08ad57037e365b9c462d71c96e4453 (patch) | |
tree | abe659c0d56cf1446fb2a0eaa3a557f3a55c6e40 /Lib/test/test_asyncio/test_events.py | |
parent | 8c0e0ab767f0d6f8395d8c317b08977563b70d41 (diff) | |
download | cpython-592ada9b4b08ad57037e365b9c462d71c96e4453.tar.gz cpython-592ada9b4b08ad57037e365b9c462d71c96e4453.zip |
asyncio: Improve canceled timer handles cleanup. Closes issue #22448.
Patch by Joshua Moore-Oliva.
Diffstat (limited to 'Lib/test/test_asyncio/test_events.py')
-rw-r--r-- | Lib/test/test_asyncio/test_events.py | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/Lib/test/test_asyncio/test_events.py b/Lib/test/test_asyncio/test_events.py index 7ac845a8a0f..a305e66d5a3 100644 --- a/Lib/test/test_asyncio/test_events.py +++ b/Lib/test/test_asyncio/test_events.py @@ -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() |