summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_asyncio
diff options
context:
space:
mode:
authorIllia Volochii <illia.volochii@gmail.com>2021-07-01 14:46:49 (GMT)
committerGitHub <noreply@github.com>2021-07-01 14:46:49 (GMT)
commitddd5f36971e2ffe20cc3f4b408425c847d168646 (patch)
tree19ac45289e1129ba41896aee92c54ecf27927216 /Lib/test/test_asyncio
parenta1092f62492a3fcd6195bea94eccf8d5a300acb1 (diff)
downloadcpython-ddd5f36971e2ffe20cc3f4b408425c847d168646.zip
cpython-ddd5f36971e2ffe20cc3f4b408425c847d168646.tar.gz
cpython-ddd5f36971e2ffe20cc3f4b408425c847d168646.tar.bz2
bpo-43234: Prohibit non-ThreadPoolExecutor in loop.set_default_executor (GH-24540)
Diffstat (limited to 'Lib/test/test_asyncio')
-rw-r--r--Lib/test/test_asyncio/test_base_events.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/test/test_asyncio/test_base_events.py b/Lib/test/test_asyncio/test_base_events.py
index 47a9fb9..adc7bd4 100644
--- a/Lib/test/test_asyncio/test_base_events.py
+++ b/Lib/test/test_asyncio/test_base_events.py
@@ -224,14 +224,14 @@ class BaseEventLoopTests(test_utils.TestCase):
self.loop.set_default_executor(executor)
self.assertIs(executor, self.loop._default_executor)
- def test_set_default_executor_deprecation_warnings(self):
+ def test_set_default_executor_error(self):
executor = mock.Mock()
- with self.assertWarns(DeprecationWarning):
+ msg = 'executor must be ThreadPoolExecutor instance'
+ with self.assertRaisesRegex(TypeError, msg):
self.loop.set_default_executor(executor)
- # Avoid cleaning up the executor mock
- self.loop._default_executor = None
+ self.assertIsNone(self.loop._default_executor)
def test_call_soon(self):
def cb():