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

This commit is contained in:
Pablo Galindo 2019-06-04 11:26:20 +01:00 committed by GitHub
parent 963eb0f473
commit 4cdbc452ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -1229,10 +1229,14 @@ os.close(fd)
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