From a357ead75ca08b93e353b89fb566abc5ee9074d9 Mon Sep 17 00:00:00 2001 From: misuzu Date: Mon, 6 Feb 2023 14:56:13 +0200 Subject: Fix test_compressed_complex failure on 32-bit platforms This test was written with the assumption that sys.maxsize is equal to 2**63 - 1 everywhere. sys.maxsize is equal to 2**31 - 1 on a 32-bit platforms and 2**63 - 1 on a 64-bit platforms. See also https://docs.python.org/3/library/sys.html#sys.maxsize --- README.rst | 1 + pymemcache/test/test_serde.py | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index 08ee9c8..8dcd0b0 100644 --- a/README.rst +++ b/README.rst @@ -137,6 +137,7 @@ Credits * `Hervé Beraud `_ * `Martin Jørgensen `_ * `Matej Spiller Muys `_ +* `misuzu `_ We're Hiring! ============= diff --git a/pymemcache/test/test_serde.py b/pymemcache/test/test_serde.py index cb92271..d9db44f 100644 --- a/pymemcache/test/test_serde.py +++ b/pymemcache/test/test_serde.py @@ -12,7 +12,6 @@ from pymemcache.serde import ( ) import pytest import pickle -import sys import zlib @@ -128,7 +127,7 @@ def test_compressed_complex(serde): check(serde, "£ $ €" * 10, FLAG_TEXT | FLAG_COMPRESSED) # test_int, doesn't make sense to compress - check(serde, sys.maxsize, FLAG_INTEGER) + check(serde, 9223372036854775807, FLAG_INTEGER) # test_pickleable check( @@ -144,4 +143,4 @@ def test_compressed_complex(serde): # test_subtype # Subclass of a native type will be restored as the same type - check(serde, CustomInt(sys.maxsize), FLAG_PICKLE | FLAG_COMPRESSED) + check(serde, CustomInt(9223372036854775807), FLAG_PICKLE | FLAG_COMPRESSED) -- cgit v1.2.1