diff options
Diffstat (limited to 'Lib/test/test_iter.py')
-rw-r--r-- | Lib/test/test_iter.py | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/Lib/test/test_iter.py b/Lib/test/test_iter.py index 7788502..a826598 100644 --- a/Lib/test/test_iter.py +++ b/Lib/test/test_iter.py @@ -75,7 +75,7 @@ class TestCase(unittest.TestCase): seq = list(range(10)) it = iter(seq) it2 = iter(it) - self.assert_(it is it2) + self.assertTrue(it is it2) # Test that for loops over iterators work def test_iter_for_loop(self): @@ -542,23 +542,23 @@ class TestCase(unittest.TestCase): def test_in_and_not_in(self): for sc5 in IteratingSequenceClass(5), SequenceClass(5): for i in range(5): - self.assert_(i in sc5) + self.assertTrue(i in sc5) for i in "abc", -1, 5, 42.42, (3, 4), [], {1: 1}, 3-12j, sc5: - self.assert_(i not in sc5) + self.assertTrue(i not in sc5) self.assertRaises(TypeError, lambda: 3 in 12) self.assertRaises(TypeError, lambda: 3 not in map) d = {"one": 1, "two": 2, "three": 3, 1j: 2j} for k in d: - self.assert_(k in d) - self.assert_(k not in d.values()) + self.assertTrue(k in d) + self.assertTrue(k not in d.values()) for v in d.values(): - self.assert_(v in d.values()) - self.assert_(v not in d) + self.assertTrue(v in d.values()) + self.assertTrue(v not in d) for k, v in d.items(): - self.assert_((k, v) in d.items()) - self.assert_((v, k) not in d.items()) + self.assertTrue((k, v) in d.items()) + self.assertTrue((v, k) not in d.items()) f = open(TESTFN, "w") try: @@ -569,9 +569,9 @@ class TestCase(unittest.TestCase): try: for chunk in "abc": f.seek(0, 0) - self.assert_(chunk not in f) + self.assertTrue(chunk not in f) f.seek(0, 0) - self.assert_((chunk + "\n") in f) + self.assertTrue((chunk + "\n") in f) finally: f.close() try: |