diff options
author | Ezio Melotti <ezio.melotti@gmail.com> | 2010-11-21 01:30:29 (GMT) |
---|---|---|
committer | Ezio Melotti <ezio.melotti@gmail.com> | 2010-11-21 01:30:29 (GMT) |
commit | 19f2aeba67b5b4dc4dfd589d02d4a0b0804e22ee (patch) | |
tree | 596b5a2c45b058ea3e0cdc49cb7539a21410b98d /Lib/test/test_itertools.py | |
parent | b65b4937e20be4a2d3311326909c77bbf2e1c4cd (diff) | |
download | cpython-19f2aeba67b5b4dc4dfd589d02d4a0b0804e22ee.zip cpython-19f2aeba67b5b4dc4dfd589d02d4a0b0804e22ee.tar.gz cpython-19f2aeba67b5b4dc4dfd589d02d4a0b0804e22ee.tar.bz2 |
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.py | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/Lib/test/test_itertools.py b/Lib/test/test_itertools.py index 16e65ca..479167e 100644 --- a/Lib/test/test_itertools.py +++ b/Lib/test/test_itertools.py @@ -195,7 +195,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 @@ -291,20 +291,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, list(filter(set(cwr).__contains__, perm))) # comb: perm that is a cwr |