[Python-checkins] bpo-37148: Fix asyncio test that check for warning when running the test suite with huntleaks (GH-13800)

Pablo Galindo webhook-mailer at python.org
Tue Jun 4 06:26:26 EDT 2019


https://github.com/python/cpython/commit/4cdbc452ce308bb55523e53963cabdc988e3f44b
commit: 4cdbc452ce308bb55523e53963cabdc988e3f44b
branch: master
author: Pablo Galindo <Pablogsal at gmail.com>
committer: GitHub <noreply at github.com>
date: 2019-06-04T11:26:20+01:00
summary:

bpo-37148: Fix asyncio test that check for warning when running the test suite with huntleaks (GH-13800)

files:
M Lib/test/test_asyncio/test_streams.py

diff --git a/Lib/test/test_asyncio/test_streams.py b/Lib/test/test_asyncio/test_streams.py
index df3d7e7dfa45..c1b9dc95ee62 100644
--- a/Lib/test/test_asyncio/test_streams.py
+++ b/Lib/test/test_asyncio/test_streams.py
@@ -1229,10 +1229,14 @@ def test_eof_feed_when_closing_writer(self):
         self.assertEqual(messages, [])
 
     def test_stream_reader_create_warning(self):
+        with contextlib.suppress(AttributeError):
+            del asyncio.StreamReader
         with self.assertWarns(DeprecationWarning):
             asyncio.StreamReader
 
     def test_stream_writer_create_warning(self):
+        with contextlib.suppress(AttributeError):
+            del asyncio.StreamWriter
         with self.assertWarns(DeprecationWarning):
             asyncio.StreamWriter
 



More information about the Python-checkins mailing list