Merged revisions 86596 via svnmerge from

svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r86596 | ezio.melotti | 2010-11-20 21:04:17 +0200 (Sat, 20 Nov 2010) | 1 line

  #9424: Replace deprecated assert* methods in the Python test suite.
........
This commit is contained in:
Ezio Melotti 2010-11-21 01:30:29 +00:00
parent b65b4937e2
commit 19f2aeba67
164 changed files with 2281 additions and 2279 deletions

View file

@ -22,7 +22,7 @@ def nestedTuple(nesting):
class ReprTests(unittest.TestCase):
def test_string(self):
eq = self.assertEquals
eq = self.assertEqual
eq(r("abc"), "'abc'")
eq(r("abcdefghijklmnop"),"'abcdefghijklmnop'")
@ -36,7 +36,7 @@ class ReprTests(unittest.TestCase):
eq(r(s), expected)
def test_tuple(self):
eq = self.assertEquals
eq = self.assertEqual
eq(r((1,)), "(1,)")
t3 = (1, 2, 3)
@ -51,7 +51,7 @@ class ReprTests(unittest.TestCase):
from array import array
from collections import deque
eq = self.assertEquals
eq = self.assertEqual
# Tuples give up after 6 elements
eq(r(()), "()")
eq(r((1,)), "(1,)")
@ -101,7 +101,7 @@ class ReprTests(unittest.TestCase):
"array('i', [1, 2, 3, 4, 5, ...])")
def test_numbers(self):
eq = self.assertEquals
eq = self.assertEqual
eq(r(123), repr(123))
eq(r(123), repr(123))
eq(r(1.0/3), repr(1.0/3))
@ -111,7 +111,7 @@ class ReprTests(unittest.TestCase):
eq(r(n), expected)
def test_instance(self):
eq = self.assertEquals
eq = self.assertEqual
i1 = ClassWithRepr("a")
eq(r(i1), repr(i1))
@ -133,7 +133,7 @@ class ReprTests(unittest.TestCase):
# XXX anonymous functions? see func_repr
def test_builtin_function(self):
eq = self.assertEquals
eq = self.assertEqual
# Functions
eq(repr(hash), '<built-in function hash>')
# Methods
@ -141,13 +141,13 @@ class ReprTests(unittest.TestCase):
'<built-in method split of str object at 0x'))
def test_range(self):
eq = self.assertEquals
eq = self.assertEqual
eq(repr(range(1)), 'range(0, 1)')
eq(repr(range(1, 2)), 'range(1, 2)')
eq(repr(range(1, 4, 3)), 'range(1, 4, 3)')
def test_nesting(self):
eq = self.assertEquals
eq = self.assertEqual
# everything is meant to give up after 6 levels.
eq(r([[[[[[[]]]]]]]), "[[[[[[[]]]]]]]")
eq(r([[[[[[[[]]]]]]]]), "[[[[[[[...]]]]]]]")
@ -168,7 +168,7 @@ class ReprTests(unittest.TestCase):
pass
def test_descriptors(self):
eq = self.assertEquals
eq = self.assertEqual
# method descriptors
eq(repr(dict.items), "<method 'items' of 'dict' objects>")
# XXX member descriptors
@ -229,7 +229,7 @@ class LongReprTest(unittest.TestCase):
del sys.path[0]
def test_module(self):
eq = self.assertEquals
eq = self.assertEqual
touch(os.path.join(self.subpkgname, self.pkgname + '.py'))
from areallylongpackageandmodulenametotestreprtruncation.areallylongpackageandmodulenametotestreprtruncation import areallylongpackageandmodulenametotestreprtruncation
eq(repr(areallylongpackageandmodulenametotestreprtruncation),
@ -237,7 +237,7 @@ class LongReprTest(unittest.TestCase):
eq(repr(sys), "<module 'sys' (built-in)>")
def test_type(self):
eq = self.assertEquals
eq = self.assertEqual
touch(os.path.join(self.subpkgname, 'foo.py'), '''\
class foo(object):
pass
@ -258,7 +258,7 @@ class bar:
''')
from areallylongpackageandmodulenametotestreprtruncation.areallylongpackageandmodulenametotestreprtruncation import bar
# Module name may be prefixed with "test.", depending on how run.
self.assertEquals(repr(bar.bar), "<class '%s.bar'>" % bar.__name__)
self.assertEqual(repr(bar.bar), "<class '%s.bar'>" % bar.__name__)
def test_instance(self):
touch(os.path.join(self.subpkgname, 'baz.py'), '''\
@ -271,7 +271,7 @@ class baz:
"<%s.baz object at 0x" % baz.__name__))
def test_method(self):
eq = self.assertEquals
eq = self.assertEqual
touch(os.path.join(self.subpkgname, 'qux.py'), '''\
class aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:
def amethod(self): pass