aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/test/test_asyncio/test_futures.py
diff options
context:
space:
mode:
authorYury Selivanov <yury@magic.io>2017-06-11 13:49:18 +0000
committerGitHub <noreply@github.com>2017-06-11 13:49:18 +0000
commit7ce1c6fb579a01bb184224a10019039fde9c8eaf (patch)
treecfae34038438eb189d445bcd6391c9c19607baf7 /Lib/test/test_asyncio/test_futures.py
parent36ff451ebae41f09560bff582c95946474d898f8 (diff)
downloadcpython-7ce1c6fb579a01bb184224a10019039fde9c8eaf.tar.gz
cpython-7ce1c6fb579a01bb184224a10019039fde9c8eaf.zip
bpo-30508: Don't log exceptions if Task/Future "cancel()" method called (#2050)
Diffstat (limited to 'Lib/test/test_asyncio/test_futures.py')
-rw-r--r--Lib/test/test_asyncio/test_futures.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_asyncio/test_futures.py b/Lib/test/test_asyncio/test_futures.py
index 99336f86ab8..5d4b2d2aa0e 100644
--- a/Lib/test/test_asyncio/test_futures.py
+++ b/Lib/test/test_asyncio/test_futures.py
@@ -319,6 +319,14 @@ class BaseFutureTests:
self.assertFalse(m_log.error.called)
@mock.patch('asyncio.base_events.logger')
+ def test_tb_logger_not_called_after_cancel(self, m_log):
+ fut = self._new_future(loop=self.loop)
+ fut.set_exception(Exception())
+ fut.cancel()
+ del fut
+ self.assertFalse(m_log.error.called)
+
+ @mock.patch('asyncio.base_events.logger')
def test_tb_logger_result_unretrieved(self, m_log):
fut = self._new_future(loop=self.loop)
fut.set_result(42)