mirror of
				https://github.com/python/cpython.git
				synced 2025-11-04 07:31:38 +00:00 
			
		
		
		
	allow more exceptions
This commit is contained in:
		
							parent
							
								
									c2f583a7f9
								
							
						
					
					
						commit
						a04a32d586
					
				
					 1 changed files with 3 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -47,8 +47,8 @@ def test_consistence(self):
 | 
			
		|||
 | 
			
		||||
        self.assertRaises(struct.error, struct.pack, 'iii', 3)
 | 
			
		||||
        self.assertRaises(struct.error, struct.pack, 'i', 3, 3, 3)
 | 
			
		||||
        self.assertRaises(struct.error, struct.pack, 'i', 'foo')
 | 
			
		||||
        self.assertRaises(struct.error, struct.pack, 'P', 'foo')
 | 
			
		||||
        self.assertRaises((TypeError, struct.error), struct.pack, 'i', 'foo')
 | 
			
		||||
        self.assertRaises((TypeError, struct.error), struct.pack, 'P', 'foo')
 | 
			
		||||
        self.assertRaises(struct.error, struct.unpack, 'd', b'flap')
 | 
			
		||||
        s = struct.pack('ii', 1, 2)
 | 
			
		||||
        self.assertRaises(struct.error, struct.unpack, 'iii', s)
 | 
			
		||||
| 
						 | 
				
			
			@ -446,7 +446,7 @@ def test_pack_into(self):
 | 
			
		|||
 | 
			
		||||
        # Test bogus offset (issue 3694)
 | 
			
		||||
        sb = small_buf
 | 
			
		||||
        self.assertRaises(TypeError, struct.pack_into, b'', sb, None)
 | 
			
		||||
        self.assertRaises((TypeError, struct.error), struct.pack_into, b'', sb, None)
 | 
			
		||||
 | 
			
		||||
    def test_pack_into_fn(self):
 | 
			
		||||
        test_string = b'Reykjavik rocks, eow!'
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue