summaryrefslogtreecommitdiff
path: root/Lib/test/test_itertools.py
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2010-11-21 13:34:58 +0000
committerEzio Melotti <ezio.melotti@gmail.com>2010-11-21 13:34:58 +0000
commit2623a37852153363335956afab010cb0beb7e74e (patch)
treee443a19bb7a87adc2158ef2e32da5c2f3b21936c /Lib/test/test_itertools.py
parent40a92f5c65767d80ebc3b3be2c2ccfc5db3afb7b (diff)
downloadcpython-git-2623a37852153363335956afab010cb0beb7e74e.tar.gz
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. ........
Diffstat (limited to 'Lib/test/test_itertools.py')
-rw-r--r--Lib/test/test_itertools.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/Lib/test/test_itertools.py b/Lib/test/test_itertools.py
index e91ac28caa..2ef35d6fcf 100644
--- a/Lib/test/test_itertools.py
+++ b/Lib/test/test_itertools.py
@@ -192,7 +192,7 @@ class TestBasicOps(unittest.TestCase):
regular_combs = list(combinations(values, r)) # compare to combs without replacement
if n == 0 or r <= 1:
- self.assertEquals(result, regular_combs) # cases that should be identical
+ self.assertEqual(result, regular_combs) # cases that should be identical
else:
self.assertTrue(set(result) >= set(regular_combs)) # rest should be supersets of regular combs
@@ -288,20 +288,20 @@ class TestBasicOps(unittest.TestCase):
comb = list(combinations(s, r))
# Check size
- self.assertEquals(len(prod), n**r)
- self.assertEquals(len(cwr), (fact(n+r-1) // fact(r) // fact(n-1)) if n else (not r))
- self.assertEquals(len(perm), 0 if r>n else fact(n) // fact(n-r))
- self.assertEquals(len(comb), 0 if r>n else fact(n) // fact(r) // fact(n-r))
+ self.assertEqual(len(prod), n**r)
+ self.assertEqual(len(cwr), (fact(n+r-1) // fact(r) // fact(n-1)) if n else (not r))
+ self.assertEqual(len(perm), 0 if r>n else fact(n) // fact(n-r))
+ self.assertEqual(len(comb), 0 if r>n else fact(n) // fact(r) // fact(n-r))
# Check lexicographic order without repeated tuples
- self.assertEquals(prod, sorted(set(prod)))
- self.assertEquals(cwr, sorted(set(cwr)))
- self.assertEquals(perm, sorted(set(perm)))
- self.assertEquals(comb, sorted(set(comb)))
+ self.assertEqual(prod, sorted(set(prod)))
+ self.assertEqual(cwr, sorted(set(cwr)))
+ self.assertEqual(perm, sorted(set(perm)))
+ self.assertEqual(comb, sorted(set(comb)))
# Check interrelationships
- self.assertEquals(cwr, [t for t in prod if sorted(t)==list(t)]) # cwr: prods which are sorted
- self.assertEquals(perm, [t for t in prod if len(set(t))==r]) # perm: prods with no dups
+ self.assertEqual(cwr, [t for t in prod if sorted(t)==list(t)]) # cwr: prods which are sorted
+ self.assertEqual(perm, [t for t in prod if len(set(t))==r]) # perm: prods with no dups
self.assertEqual(comb, [t for t in perm if sorted(t)==list(t)]) # comb: perms that are sorted
self.assertEqual(comb, [t for t in cwr if len(set(t))==r]) # comb: cwrs without dups
self.assertEqual(comb, filter(set(cwr).__contains__, perm)) # comb: perm that is a cwr