[pypy-commit] pypy py3k: s/maxint/maxsize/g in applevel tests

amauryfa noreply at buildbot.pypy.org
Sun Dec 2 10:03:28 CET 2012


Author: Amaury Forgeot d'Arc <amauryfa at gmail.com>
Branch: py3k
Changeset: r59208:ca88ab756b58
Date: 2012-12-02 10:02 +0100
http://bitbucket.org/pypy/pypy/changeset/ca88ab756b58/

Log:	s/maxint/maxsize/g in applevel tests

diff --git a/pypy/objspace/std/test/test_intobject.py b/pypy/objspace/std/test/test_intobject.py
--- a/pypy/objspace/std/test/test_intobject.py
+++ b/pypy/objspace/std/test/test_intobject.py
@@ -321,7 +321,7 @@
 
     def test_int_largenums(self):
         import sys
-        for x in [-sys.maxint-1, -1, sys.maxint]:
+        for x in [-sys.maxsize-1, -1, sys.maxsize]:
             y = int(str(x))
             assert y == x
             assert type(y) is int
@@ -332,7 +332,7 @@
 
     def test_overflow(self):
         import sys
-        n = sys.maxint + 1
+        n = sys.maxsize + 1
         assert isinstance(n, int)
 
     def test_pow(self):
diff --git a/pypy/objspace/std/test/test_longobject.py b/pypy/objspace/std/test/test_longobject.py
--- a/pypy/objspace/std/test/test_longobject.py
+++ b/pypy/objspace/std/test/test_longobject.py
@@ -244,7 +244,7 @@
 
     def test_long(self):
         import sys
-        n = -sys.maxint-1
+        n = -sys.maxsize-1
         assert int(n) == n
         assert str(int(n)) == str(n)
 
diff --git a/pypy/objspace/std/test/test_smalllongobject.py b/pypy/objspace/std/test/test_smalllongobject.py
--- a/pypy/objspace/std/test/test_smalllongobject.py
+++ b/pypy/objspace/std/test/test_smalllongobject.py
@@ -100,7 +100,7 @@
 
     def test_sl_add_32(self):
         import sys, __pypy__
-        if sys.maxint == 2147483647:
+        if sys.maxsize == 2147483647:
             x = 2147483647
             assert x + x == 4294967294
             assert 'SmallLong' in __pypy__.internal_repr(x + x)
diff --git a/pypy/objspace/std/test/test_stringformat.py b/pypy/objspace/std/test/test_stringformat.py
--- a/pypy/objspace/std/test/test_stringformat.py
+++ b/pypy/objspace/std/test/test_stringformat.py
@@ -101,8 +101,8 @@
         assert '0x0' == '%#x' % z
         assert '23' == '%s' % n
         assert '23' == '%r' % n
-        assert ('%d' % (-sys.maxint-1,) == '-' + str(sys.maxint+1)
-                                        == '-%d' % (sys.maxint+1,))
+        assert ('%d' % (-sys.maxsize-1,) == '-' + str(sys.maxsize+1)
+                                         == '-%d' % (sys.maxsize+1,))
         n = 28
         m = 8
         assert '1C' == '%X' % n
diff --git a/pypy/objspace/std/test/test_strsliceobject.py b/pypy/objspace/std/test/test_strsliceobject.py
--- a/pypy/objspace/std/test/test_strsliceobject.py
+++ b/pypy/objspace/std/test/test_strsliceobject.py
@@ -41,7 +41,7 @@
 
     def test_index(self):
         import __pypy__, sys
-        m = sys.maxint
+        m = sys.maxsize
         def slice(s): return (s*3)[len(s):-len(s)]
         s = slice(b'abcdefghiabc' * 20)
         assert 'W_StringSliceObject' in __pypy__.internal_repr(s)
@@ -69,7 +69,7 @@
 
     def test_rindex(self):
         import __pypy__
-        from sys import maxint
+        from sys import maxsize
         def slice(s): return (s*3)[len(s):-len(s)]
         s = slice(b"X" * 100 + b'abcdefghiabc')
         assert 'W_StringSliceObject' in __pypy__.internal_repr(s)
@@ -77,7 +77,7 @@
         assert s.rindex(b'def') == 103
         assert s.rindex(b'abc') == 109
         assert s.rindex(b'abc', 0, -1) == 100
-        assert s.rindex(b'abc', -4*maxint, 4*maxint) == 109
+        assert s.rindex(b'abc', -4*maxsize, 4*maxsize) == 109
         raises(ValueError, slice(b'abcdefghiabc' * 20).rindex, b'hib')
         raises(ValueError, slice(b'defghiabc' + b"X" * 100).rindex, b'def', 1)
         raises(ValueError, slice(b'defghiabc' + b"X" * 100).rindex, b'abc', 0, -101)


More information about the pypy-commit mailing list