mirror of
				https://github.com/python/cpython.git
				synced 2025-10-30 21:21:22 +00:00 
			
		
		
		
	bpo-34215: Clarify IncompleteReadError message when "expected" is None (GH-21925)
Co-Authored-By: Tyler Bell <mrbell321@gmail.com>
This commit is contained in:
		
							parent
							
								
									5b0194ed31
								
							
						
					
					
						commit
						8085f742f4
					
				
					 3 changed files with 9 additions and 4 deletions
				
			
		|  | @ -444,12 +444,14 @@ def test_readuntil_multi_chunks_1(self): | |||
| 
 | ||||
|     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) | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Zackery Spytz
						Zackery Spytz