diff options
author | Zackery Spytz <zspytz@gmail.com> | 2020-11-28 14:27:28 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-28 14:27:28 (GMT) |
commit | 8085f742f4adfbc85f13fc734dfab036aa23acfb (patch) | |
tree | ee08b5f84d732556b0fde7d2adae42c7342445b0 /Lib/test/test_asyncio | |
parent | 5b0194ed31376382da63ad5b10271a4acc4a80e8 (diff) | |
download | cpython-8085f742f4adfbc85f13fc734dfab036aa23acfb.zip cpython-8085f742f4adfbc85f13fc734dfab036aa23acfb.tar.gz cpython-8085f742f4adfbc85f13fc734dfab036aa23acfb.tar.bz2 |
bpo-34215: Clarify IncompleteReadError message when "expected" is None (GH-21925)
Co-Authored-By: Tyler Bell <mrbell321@gmail.com>
Diffstat (limited to 'Lib/test/test_asyncio')
-rw-r--r-- | Lib/test/test_asyncio/test_streams.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Lib/test/test_asyncio/test_streams.py b/Lib/test/test_asyncio/test_streams.py index a6cfcbf..aa39779 100644 --- a/Lib/test/test_asyncio/test_streams.py +++ b/Lib/test/test_asyncio/test_streams.py @@ -444,12 +444,14 @@ class StreamTests(test_utils.TestCase): def test_readuntil_eof(self): stream = asyncio.StreamReader(loop=self.loop) - stream.feed_data(b'some dataAA') + data = b'some dataAA' + stream.feed_data(data) stream.feed_eof() - with self.assertRaises(asyncio.IncompleteReadError) as cm: + with self.assertRaisesRegex(asyncio.IncompleteReadError, + 'undefined expected bytes') as cm: self.loop.run_until_complete(stream.readuntil(b'AAA')) - self.assertEqual(cm.exception.partial, b'some dataAA') + self.assertEqual(cm.exception.partial, data) self.assertIsNone(cm.exception.expected) self.assertEqual(b'', stream._buffer) |