summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_iter.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2009-06-30 23:06:06 (GMT)
committerBenjamin Peterson <benjamin@python.org>2009-06-30 23:06:06 (GMT)
commitc9c0f201fed21efcf669dbbf5f923eaf0eeb1db9 (patch)
tree6350dab0b481e6de307dc4e043c6230f463a9ca7 /Lib/test/test_iter.py
parent98d23f2e065713ccfbc07d9a0b65f737a212bfb5 (diff)
downloadcpython-c9c0f201fed21efcf669dbbf5f923eaf0eeb1db9.zip
cpython-c9c0f201fed21efcf669dbbf5f923eaf0eeb1db9.tar.gz
cpython-c9c0f201fed21efcf669dbbf5f923eaf0eeb1db9.tar.bz2
convert old fail* assertions to assert*
Diffstat (limited to 'Lib/test/test_iter.py')
-rw-r--r--Lib/test/test_iter.py22
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: