Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e856710 commit 5c6e6fcCopy full SHA for 5c6e6fc
1 file changed
Lib/test/test_os.py
@@ -44,9 +44,9 @@
44
except ImportError:
45
_winapi = None
46
try:
47
- from _testcapi import INT_MAX
+ from _testcapi import INT_MAX, PY_SSIZE_T_MAX
48
49
- INT_MAX = 2 ** 31 - 1
+ INT_MAX = PY_SSIZE_T_MAX = sys.maxsize
50
51
from test.script_helper import assert_python_ok
52
@@ -124,6 +124,10 @@ def test_read(self):
124
self.assertEqual(s, b"spam")
125
126
@support.cpython_only
127
+ # Skip the test on 32-bit platforms: the number of bytes must fit in a
128
+ # Py_ssize_t type
129
+ @unittest.skipUnless(INT_MAX < PY_SSIZE_T_MAX,
130
+ "needs INT_MAX < PY_SSIZE_T_MAX")
131
@support.bigmemtest(size=INT_MAX + 10, memuse=1, dry_run=False)
132
def test_large_read(self, size):
133
with open(support.TESTFN, "wb") as fp:
0 commit comments