mirror of
				https://github.com/msgpack/msgpack-python.git
				synced 2025-11-04 03:20:56 +00:00 
			
		
		
		
	Fix PyPy fail.
This commit is contained in:
		
							parent
							
								
									5fb9d8a7fd
								
							
						
					
					
						commit
						a72e75d7c8
					
				
					 1 changed files with 28 additions and 26 deletions
				
			
		| 
						 | 
					@ -32,29 +32,31 @@ def test_map_header():
 | 
				
			||||||
        packer.pack_array_header(2**32)
 | 
					        packer.pack_array_header(2**32)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@pytest.mark.skipif(True, reason="Requires very large memory.")
 | 
					# PyPy fails following tests because of constant folding?
 | 
				
			||||||
def test_binary():
 | 
					# https://bugs.pypy.org/issue1721
 | 
				
			||||||
    x = b'x' * (2**32 - 1)
 | 
					#@pytest.mark.skipif(True, reason="Requires very large memory.")
 | 
				
			||||||
    assert unpackb(packb(x)) == x
 | 
					#def test_binary():
 | 
				
			||||||
    del x
 | 
					#    x = b'x' * (2**32 - 1)
 | 
				
			||||||
    x = b'x' * (2**32)
 | 
					#    assert unpackb(packb(x)) == x
 | 
				
			||||||
    with pytest.raises(ValueError):
 | 
					#    del x
 | 
				
			||||||
        packb(x)
 | 
					#    x = b'x' * (2**32)
 | 
				
			||||||
 | 
					#    with pytest.raises(ValueError):
 | 
				
			||||||
 | 
					#        packb(x)
 | 
				
			||||||
@pytest.mark.skipif(True, reason="Requires very large memory.")
 | 
					#
 | 
				
			||||||
def test_string():
 | 
					#
 | 
				
			||||||
    x = 'x' * (2**32 - 1)
 | 
					#@pytest.mark.skipif(True, reason="Requires very large memory.")
 | 
				
			||||||
    assert unpackb(packb(x)) == x
 | 
					#def test_string():
 | 
				
			||||||
    x += 'y'
 | 
					#    x = 'x' * (2**32 - 1)
 | 
				
			||||||
    with pytest.raises(ValueError):
 | 
					#    assert unpackb(packb(x)) == x
 | 
				
			||||||
        packb(x)
 | 
					#    x += 'y'
 | 
				
			||||||
 | 
					#    with pytest.raises(ValueError):
 | 
				
			||||||
 | 
					#        packb(x)
 | 
				
			||||||
@pytest.mark.skipif(True, reason="Requires very large memory.")
 | 
					#
 | 
				
			||||||
def test_array():
 | 
					#
 | 
				
			||||||
    x = [0] * (2**32 - 1)
 | 
					#@pytest.mark.skipif(True, reason="Requires very large memory.")
 | 
				
			||||||
    assert unpackb(packb(x)) == x
 | 
					#def test_array():
 | 
				
			||||||
    x.append(0)
 | 
					#    x = [0] * (2**32 - 1)
 | 
				
			||||||
    with pytest.raises(ValueError):
 | 
					#    assert unpackb(packb(x)) == x
 | 
				
			||||||
        packb(x)
 | 
					#    x.append(0)
 | 
				
			||||||
 | 
					#    with pytest.raises(ValueError):
 | 
				
			||||||
 | 
					#        packb(x)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue