summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_asyncio
diff options
context:
space:
mode:
authorYury Selivanov <yury@magic.io>2016-09-15 19:58:15 (GMT)
committerYury Selivanov <yury@magic.io>2016-09-15 19:58:15 (GMT)
commit45dccdad93fbfa5c2b90a697b47d5286115827aa (patch)
tree01fd44537abe8ab50c6f8ecb9749b8555e163f35 /Lib/test/test_asyncio
parent5587d7c071e5725d8aaf565b985441011cb1449f (diff)
downloadcpython-45dccdad93fbfa5c2b90a697b47d5286115827aa.zip
cpython-45dccdad93fbfa5c2b90a697b47d5286115827aa.tar.gz
cpython-45dccdad93fbfa5c2b90a697b47d5286115827aa.tar.bz2
Issue #26654: Inspect functools.partial in asyncio.Handle.__repr__.
Patch by iceboy.
Diffstat (limited to 'Lib/test/test_asyncio')
-rw-r--r--Lib/test/test_asyncio/test_events.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/Lib/test/test_asyncio/test_events.py b/Lib/test/test_asyncio/test_events.py
index 7c901f2..b3f35ce 100644
--- a/Lib/test/test_asyncio/test_events.py
+++ b/Lib/test/test_asyncio/test_events.py
@@ -2224,7 +2224,7 @@ else:
return asyncio.SelectorEventLoop(selectors.SelectSelector())
-def noop(*args):
+def noop(*args, **kwargs):
pass
@@ -2305,6 +2305,13 @@ class HandleTests(test_utils.TestCase):
% (re.escape(filename), lineno))
self.assertRegex(repr(h), regex)
+ # partial function with keyword args
+ cb = functools.partial(noop, x=1)
+ h = asyncio.Handle(cb, (2, 3), self.loop)
+ regex = (r'^<Handle noop\(x=1\)\(2, 3\) at %s:%s>$'
+ % (re.escape(filename), lineno))
+ self.assertRegex(repr(h), regex)
+
# partial method
if sys.version_info >= (3, 4):
method = HandleTests.test_handle_repr