Commits

Amaury Forgeot d'Arc committed ca88ab7

s/maxint/maxsize/g in applevel tests

  • Participants
  • Parent commits 747c939
  • Branches py3k

Comments (0)

Files changed (5)

File pypy/objspace/std/test/test_intobject.py

 
     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
 
     def test_overflow(self):
         import sys
-        n = sys.maxint + 1
+        n = sys.maxsize + 1
         assert isinstance(n, int)
 
     def test_pow(self):

File pypy/objspace/std/test/test_longobject.py

 
     def test_long(self):
         import sys
-        n = -sys.maxint-1
+        n = -sys.maxsize-1
         assert int(n) == n
         assert str(int(n)) == str(n)
 

File pypy/objspace/std/test/test_smalllongobject.py

 
     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)

File pypy/objspace/std/test/test_stringformat.py

         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

File pypy/objspace/std/test/test_strsliceobject.py

 
     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)
 
     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)
         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)