mirror of
https://github.com/msgpack/msgpack-python.git
synced 2025-11-01 01:50:54 +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)
|
||||
|
||||
|
||||
@pytest.mark.skipif(True, reason="Requires very large memory.")
|
||||
def test_binary():
|
||||
x = b'x' * (2**32 - 1)
|
||||
assert unpackb(packb(x)) == x
|
||||
del 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)
|
||||
assert unpackb(packb(x)) == 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)
|
||||
assert unpackb(packb(x)) == x
|
||||
x.append(0)
|
||||
with pytest.raises(ValueError):
|
||||
packb(x)
|
||||
# PyPy fails following tests because of constant folding?
|
||||
# https://bugs.pypy.org/issue1721
|
||||
#@pytest.mark.skipif(True, reason="Requires very large memory.")
|
||||
#def test_binary():
|
||||
# x = b'x' * (2**32 - 1)
|
||||
# assert unpackb(packb(x)) == x
|
||||
# del 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)
|
||||
# assert unpackb(packb(x)) == 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)
|
||||
# assert unpackb(packb(x)) == x
|
||||
# x.append(0)
|
||||
# with pytest.raises(ValueError):
|
||||
# packb(x)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue