summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_asyncio/test_streams.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_asyncio/test_streams.py')
-rw-r--r--Lib/test/test_asyncio/test_streams.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/test/test_asyncio/test_streams.py b/Lib/test/test_asyncio/test_streams.py
index a7d1789..098a0da 100644
--- a/Lib/test/test_asyncio/test_streams.py
+++ b/Lib/test/test_asyncio/test_streams.py
@@ -813,7 +813,7 @@ os.close(fd)
with self.assertWarns(DeprecationWarning) as cm:
with self.assertRaisesRegex(RuntimeError, 'There is no current event loop'):
asyncio.StreamReader()
- self.assertEqual(cm.warnings[0].filename, __file__)
+ self.assertEqual(cm.filename, __file__)
def test_streamreader_constructor_use_running_loop(self):
# asyncio issue #184: Ensure that StreamReaderProtocol constructor
@@ -832,7 +832,7 @@ os.close(fd)
asyncio.set_event_loop(self.loop)
with self.assertWarns(DeprecationWarning) as cm:
reader = asyncio.StreamReader()
- self.assertEqual(cm.warnings[0].filename, __file__)
+ self.assertEqual(cm.filename, __file__)
self.assertIs(reader._loop, self.loop)
@@ -841,7 +841,7 @@ os.close(fd)
with self.assertWarns(DeprecationWarning) as cm:
with self.assertRaisesRegex(RuntimeError, 'There is no current event loop'):
asyncio.StreamReaderProtocol(reader)
- self.assertEqual(cm.warnings[0].filename, __file__)
+ self.assertEqual(cm.filename, __file__)
def test_streamreaderprotocol_constructor_use_running_loop(self):
# asyncio issue #184: Ensure that StreamReaderProtocol constructor
@@ -861,7 +861,7 @@ os.close(fd)
reader = mock.Mock()
with self.assertWarns(DeprecationWarning) as cm:
protocol = asyncio.StreamReaderProtocol(reader)
- self.assertEqual(cm.warnings[0].filename, __file__)
+ self.assertEqual(cm.filename, __file__)
self.assertIs(protocol._loop, self.loop)
def test_drain_raises(self):