changeset: 91659:880e2cdac8b1 user: Victor Stinner date: Sat Jul 12 11:03:53 2014 +0200 files: Lib/test/test_os.py description: Issue #21932: Skip test_os.test_large_read() on 32-bit system diff -r 9b450b19aa11 -r 880e2cdac8b1 Lib/test/test_os.py --- a/Lib/test/test_os.py Sat Jul 12 03:20:40 2014 +0200 +++ b/Lib/test/test_os.py Sat Jul 12 11:03:53 2014 +0200 @@ -44,9 +44,9 @@ 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 @@ 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: