summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_bisect.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2009-06-30 22:57:08 (GMT)
committerBenjamin Peterson <benjamin@python.org>2009-06-30 22:57:08 (GMT)
commit5c8da86f3a515ce1a6d5f27fd15e3c5f4d8e931e (patch)
tree41f38aca16748628d53906337f06fdf087f52314 /Lib/test/test_bisect.py
parentbe96cf608fa656d7e53144cf85082ed5661e8c13 (diff)
downloadcpython-5c8da86f3a515ce1a6d5f27fd15e3c5f4d8e931e.zip
cpython-5c8da86f3a515ce1a6d5f27fd15e3c5f4d8e931e.tar.gz
cpython-5c8da86f3a515ce1a6d5f27fd15e3c5f4d8e931e.tar.bz2
convert usage of fail* to assert*
Diffstat (limited to 'Lib/test/test_bisect.py')
-rw-r--r--Lib/test/test_bisect.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/Lib/test/test_bisect.py b/Lib/test/test_bisect.py
index 66bae48..934ba8c 100644
--- a/Lib/test/test_bisect.py
+++ b/Lib/test/test_bisect.py
@@ -130,14 +130,14 @@ class TestBisect(unittest.TestCase):
elem = randrange(-1, n+1)
ip = self.module.bisect_left(data, elem)
if ip < len(data):
- self.failUnless(elem <= data[ip])
+ self.assertTrue(elem <= data[ip])
if ip > 0:
- self.failUnless(data[ip-1] < elem)
+ self.assertTrue(data[ip-1] < elem)
ip = self.module.bisect_right(data, elem)
if ip < len(data):
- self.failUnless(elem < data[ip])
+ self.assertTrue(elem < data[ip])
if ip > 0:
- self.failUnless(data[ip-1] <= elem)
+ self.assertTrue(data[ip-1] <= elem)
def test_optionalSlicing(self):
for func, data, elem, expected in self.precomputedCases:
@@ -146,15 +146,15 @@ class TestBisect(unittest.TestCase):
for hi in xrange(3,8):
hi = min(len(data), hi)
ip = func(data, elem, lo, hi)
- self.failUnless(lo <= ip <= hi)
+ self.assertTrue(lo <= ip <= hi)
if func is self.module.bisect_left and ip < hi:
- self.failUnless(elem <= data[ip])
+ self.assertTrue(elem <= data[ip])
if func is self.module.bisect_left and ip > lo:
- self.failUnless(data[ip-1] < elem)
+ self.assertTrue(data[ip-1] < elem)
if func is self.module.bisect_right and ip < hi:
- self.failUnless(elem < data[ip])
+ self.assertTrue(elem < data[ip])
if func is self.module.bisect_right and ip > lo:
- self.failUnless(data[ip-1] <= elem)
+ self.assertTrue(data[ip-1] <= elem)
self.assertEqual(ip, max(lo, min(hi, expected)))
def test_backcompatibility(self):