summaryrefslogtreecommitdiff
path: root/Lib/test/test_asyncio/test_tasks.py
diff options
context:
space:
mode:
authorYury Selivanov <yury@magic.io>2016-11-04 14:29:28 -0400
committerYury Selivanov <yury@magic.io>2016-11-04 14:29:28 -0400
commit600a349781bfa0a8239e1cb95fac29c7c4a3302e (patch)
tree79f35114de7101a97fe85f80cd02cbd866d4abd9 /Lib/test/test_asyncio/test_tasks.py
parent1ea023e523f484955fb81b59a72c586845d8d97f (diff)
downloadcpython-git-600a349781bfa0a8239e1cb95fac29c7c4a3302e.tar.gz
Issue #28613: Fix get_event_loop() to return the current loop
when called from coroutines or callbacks.
Diffstat (limited to 'Lib/test/test_asyncio/test_tasks.py')
-rw-r--r--Lib/test/test_asyncio/test_tasks.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_asyncio/test_tasks.py b/Lib/test/test_asyncio/test_tasks.py
index 1ceb9b28cb..22accf5d1e 100644
--- a/Lib/test/test_asyncio/test_tasks.py
+++ b/Lib/test/test_asyncio/test_tasks.py
@@ -75,6 +75,7 @@ class Dummy:
class TaskTests(test_utils.TestCase):
def setUp(self):
+ super().setUp()
self.loop = self.new_test_loop()
def test_other_loop_future(self):
@@ -1933,6 +1934,7 @@ class TaskTests(test_utils.TestCase):
class GatherTestsBase:
def setUp(self):
+ super().setUp()
self.one_loop = self.new_test_loop()
self.other_loop = self.new_test_loop()
self.set_event_loop(self.one_loop, cleanup=False)
@@ -2216,6 +2218,7 @@ class RunCoroutineThreadsafeTests(test_utils.TestCase):
"""Test case for asyncio.run_coroutine_threadsafe."""
def setUp(self):
+ super().setUp()
self.loop = asyncio.new_event_loop()
self.set_event_loop(self.loop) # Will cleanup properly
@@ -2306,12 +2309,14 @@ class RunCoroutineThreadsafeTests(test_utils.TestCase):
class SleepTests(test_utils.TestCase):
def setUp(self):
+ super().setUp()
self.loop = asyncio.new_event_loop()
asyncio.set_event_loop(None)
def tearDown(self):
self.loop.close()
self.loop = None
+ super().tearDown()
def test_sleep_zero(self):
result = 0