◐ Shell
clean mode source ↗

bpo-37148: Fix asyncio test that check for warning when running the t… · python/cpython@4cdbc45

Original file line numberDiff line numberDiff line change

@@ -1229,10 +1229,14 @@ def test_eof_feed_when_closing_writer(self):

12291229

self.assertEqual(messages, [])

12301230
12311231

def test_stream_reader_create_warning(self):

1232+

with contextlib.suppress(AttributeError):

1233+

del asyncio.StreamReader

12321234

with self.assertWarns(DeprecationWarning):

12331235

asyncio.StreamReader

12341236
12351237

def test_stream_writer_create_warning(self):

1238+

with contextlib.suppress(AttributeError):

1239+

del asyncio.StreamWriter

12361240

with self.assertWarns(DeprecationWarning):

12371241

asyncio.StreamWriter

12381242