diff options
Diffstat (limited to 'Lib/test/test_itertools.py')
-rw-r--r-- | Lib/test/test_itertools.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Lib/test/test_itertools.py b/Lib/test/test_itertools.py index af2efa0..d917262 100644 --- a/Lib/test/test_itertools.py +++ b/Lib/test/test_itertools.py @@ -131,7 +131,7 @@ class TestBasicOps(unittest.TestCase): self.assertEqual(len(c), r) # r-length combinations self.assertEqual(len(set(c)), r) # no duplicate elements self.assertEqual(list(c), sorted(c)) # keep original ordering - self.assert_(all(e in values for e in c)) # elements taken from input iterable + self.assertTrue(all(e in values for e in c)) # elements taken from input iterable self.assertEqual(list(c), [e for e in values if e in c]) # comb is a subsequence of the input iterable self.assertEqual(result, list(combinations1(values, r))) # matches first pure python version @@ -195,14 +195,14 @@ class TestBasicOps(unittest.TestCase): if n == 0 or r <= 1: self.assertEquals(result, regular_combs) # cases that should be identical else: - self.assert_(set(result) >= set(regular_combs)) # rest should be supersets of regular combs + self.assertTrue(set(result) >= set(regular_combs)) # rest should be supersets of regular combs for c in result: self.assertEqual(len(c), r) # r-length combinations noruns = [k for k,v in groupby(c)] # combo without consecutive repeats self.assertEqual(len(noruns), len(set(noruns))) # no repeats other than consecutive self.assertEqual(list(c), sorted(c)) # keep original ordering - self.assert_(all(e in values for e in c)) # elements taken from input iterable + self.assertTrue(all(e in values for e in c)) # elements taken from input iterable self.assertEqual(noruns, [e for e in values if e in c]) # comb is a subsequence of the input iterable self.assertEqual(result, list(cwr1(values, r))) # matches first pure python version @@ -265,7 +265,7 @@ class TestBasicOps(unittest.TestCase): for p in result: self.assertEqual(len(p), r) # r-length permutations self.assertEqual(len(set(p)), r) # no duplicate elements - self.assert_(all(e in values for e in p)) # elements taken from input iterable + self.assertTrue(all(e in values for e in p)) # elements taken from input iterable self.assertEqual(result, list(permutations1(values, r))) # matches first pure python version self.assertEqual(result, list(permutations2(values, r))) # matches second pure python version if r == n: @@ -836,7 +836,7 @@ class TestBasicOps(unittest.TestCase): # tee pass-through to copyable iterator a, b = tee('abc') c, d = tee(a) - self.assert_(a is c) + self.assertTrue(a is c) # test tee_new t1, t2 = tee('abc') @@ -844,7 +844,7 @@ class TestBasicOps(unittest.TestCase): self.assertRaises(TypeError, tnew) self.assertRaises(TypeError, tnew, 10) t3 = tnew(t1) - self.assert_(list(t1) == list(t2) == list(t3) == list('abc')) + self.assertTrue(list(t1) == list(t2) == list(t3) == list('abc')) # test that tee objects are weak referencable a, b = tee(range(10)) @@ -1356,7 +1356,7 @@ class SubclassWithKwargsTest(unittest.TestCase): Subclass(newarg=1) except TypeError as err: # we expect type errors because of wrong argument count - self.failIf("does not take keyword arguments" in err.args[0]) + self.assertFalse("does not take keyword arguments" in err.args[0]) libreftest = """ Doctest for examples in the library reference: libitertools.tex |