aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/test/test_asyncio/utils.py
diff options
context:
space:
mode:
authorYury Selivanov <yury@magic.io>2018-01-21 14:56:59 -0500
committerGitHub <noreply@github.com>2018-01-21 14:56:59 -0500
commita4afcdfa55ddffa4b9ae3b0cf101628c7bff4102 (patch)
tree61649205a7b3d95fed03f643b66c568aab79be3a /Lib/test/test_asyncio/utils.py
parentfc2f407829d9817ddacccae6944dd0879cfaca24 (diff)
downloadcpython-a4afcdfa55ddffa4b9ae3b0cf101628c7bff4102.tar.gz
cpython-a4afcdfa55ddffa4b9ae3b0cf101628c7bff4102.zip
bpo-32314: Fix asyncio.run() to cancel runinng tasks on shutdown (#5262)
Diffstat (limited to 'Lib/test/test_asyncio/utils.py')
-rw-r--r--Lib/test/test_asyncio/utils.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_asyncio/utils.py b/Lib/test/test_asyncio/utils.py
index 6c809770b4a..f756ec9016f 100644
--- a/Lib/test/test_asyncio/utils.py
+++ b/Lib/test/test_asyncio/utils.py
@@ -485,6 +485,14 @@ class MockPattern(str):
return bool(re.search(str(self), other, re.S))
+class MockInstanceOf:
+ def __init__(self, type):
+ self._type = type
+
+ def __eq__(self, other):
+ return isinstance(other, self._type)
+
+
def get_function_source(func):
source = format_helpers._get_function_source(func)
if source is None: