summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2014-07-12 09:03:53 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2014-07-12 09:03:53 (GMT)
commit5c6e6fc57e651711d92f470e68621cc8230e064c (patch)
tree0f38aa5795d6ba51dc3f3fd2ea236a5b4f770c8d /Lib/test
parente8567106c05f5dcaf397666b48bb67ea202250a2 (diff)
downloadcpython-5c6e6fc57e651711d92f470e68621cc8230e064c.zip
cpython-5c6e6fc57e651711d92f470e68621cc8230e064c.tar.gz
cpython-5c6e6fc57e651711d92f470e68621cc8230e064c.tar.bz2
Issue #21932: Skip test_os.test_large_read() on 32-bit system
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_os.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py
index 5348b12b..e669df8 100644
--- a/Lib/test/test_os.py
+++ b/Lib/test/test_os.py
@@ -44,9 +44,9 @@ try:
except ImportError:
_winapi = None
try:
- from _testcapi import INT_MAX
+ from _testcapi import INT_MAX, PY_SSIZE_T_MAX
except ImportError:
- INT_MAX = 2 ** 31 - 1
+ INT_MAX = PY_SSIZE_T_MAX = sys.maxsize
from test.script_helper import assert_python_ok
@@ -124,6 +124,10 @@ class FileTests(unittest.TestCase):
self.assertEqual(s, b"spam")
@support.cpython_only
+ # Skip the test on 32-bit platforms: the number of bytes must fit in a
+ # Py_ssize_t type
+ @unittest.skipUnless(INT_MAX < PY_SSIZE_T_MAX,
+ "needs INT_MAX < PY_SSIZE_T_MAX")
@support.bigmemtest(size=INT_MAX + 10, memuse=1, dry_run=False)
def test_large_read(self, size):
with open(support.TESTFN, "wb") as fp: