Skip to content

Commit

Permalink
Skip big integer encoding tests on PyPy for now
Browse files Browse the repository at this point in the history
  • Loading branch information
JustAnotherArchivist committed Jun 16, 2022
1 parent a8b35ef commit 655e146
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions tests/test_ujson.py
Expand Up @@ -610,11 +610,17 @@ def test_decode_numeric_int_exp(test_input):
10**25, # very positive
],
)
def test_encode_decode_big_int(i):
@pytest.mark.parametrize("mode", ["encode", "decode"])
def test_encode_decode_big_int(i, mode):
# Test ints that are too large to be represented by a C integer type
for py, j in ((i, str(i)), ([i], f"[{i}]"), ({"i": i}, f'{{"i":{i}}}')):
assert ujson.encode(py) == j
assert ujson.decode(j) == py
if mode == "encode":
if hasattr(sys, "pypy_version_info"):
# https://foss.heptapod.net/pypy/pypy/-/issues/3765
pytest.skip("PyPy can't serialise big ints")
assert ujson.encode(py) == j
else:
assert ujson.decode(j) == py


@pytest.mark.parametrize(
Expand Down

0 comments on commit 655e146

Please sign in to comment.