summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_asyncio/test_events.py
diff options
context:
space:
mode:
authorYury Selivanov <yselivanov@sprymix.com>2014-09-25 16:09:09 (GMT)
committerYury Selivanov <yselivanov@sprymix.com>2014-09-25 16:09:09 (GMT)
commit1cfd36fdd789d443a0bfe61ca5799e047331aae8 (patch)
tree5b2c4ea6e0506c878812143c22dcf5f06ceb59d6 /Lib/test/test_asyncio/test_events.py
parentbca9acf7ca9106f082601e72b9da7cea6b33b1f0 (diff)
downloadcpython-1cfd36fdd789d443a0bfe61ca5799e047331aae8.zip
cpython-1cfd36fdd789d443a0bfe61ca5799e047331aae8.tar.gz
cpython-1cfd36fdd789d443a0bfe61ca5799e047331aae8.tar.bz2
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.py14
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 7ac845a..a305e66 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()