summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_asyncio/test_base_events.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_asyncio/test_base_events.py')
-rw-r--r--Lib/test/test_asyncio/test_base_events.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/Lib/test/test_asyncio/test_base_events.py b/Lib/test/test_asyncio/test_base_events.py
index bda8cc6..f3ae140 100644
--- a/Lib/test/test_asyncio/test_base_events.py
+++ b/Lib/test/test_asyncio/test_base_events.py
@@ -1,5 +1,6 @@
"""Tests for base_events.py"""
+import concurrent.futures
import errno
import logging
import math
@@ -211,10 +212,21 @@ class BaseEventLoopTests(test_utils.TestCase):
self.assertFalse(self.loop._ready)
def test_set_default_executor(self):
- executor = mock.Mock()
+ class DummyExecutor(concurrent.futures.ThreadPoolExecutor):
+ def submit(self, fn, *args, **kwargs):
+ raise NotImplementedError(
+ 'cannot submit into a dummy executor')
+
+ executor = DummyExecutor()
self.loop.set_default_executor(executor)
self.assertIs(executor, self.loop._default_executor)
+ def test_set_default_executor_deprecation_warnings(self):
+ executor = mock.Mock()
+
+ with self.assertWarns(DeprecationWarning):
+ self.loop.set_default_executor(executor)
+
def test_call_soon(self):
def cb():
pass