From 044701d4abf8352cec8ba6a902e5b6c183a4d06c Mon Sep 17 00:00:00 2001 From: JustAnotherArchivist Date: Thu, 16 Jun 2022 17:18:07 +0000 Subject: [PATCH] Skip big integer encoding tests on PyPy for now --- tests/test_ujson.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/test_ujson.py b/tests/test_ujson.py index e3c1f479..c5dca0b8 100644 --- a/tests/test_ujson.py +++ b/tests/test_ujson.py @@ -574,11 +574,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(