diff options
author | Benjamin Peterson <benjamin@python.org> | 2009-06-30 23:06:06 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2009-06-30 23:06:06 (GMT) |
commit | c9c0f201fed21efcf669dbbf5f923eaf0eeb1db9 (patch) | |
tree | 6350dab0b481e6de307dc4e043c6230f463a9ca7 /Lib/test/test_contains.py | |
parent | 98d23f2e065713ccfbc07d9a0b65f737a212bfb5 (diff) | |
download | cpython-c9c0f201fed21efcf669dbbf5f923eaf0eeb1db9.zip cpython-c9c0f201fed21efcf669dbbf5f923eaf0eeb1db9.tar.gz cpython-c9c0f201fed21efcf669dbbf5f923eaf0eeb1db9.tar.bz2 |
convert old fail* assertions to assert*
Diffstat (limited to 'Lib/test/test_contains.py')
-rw-r--r-- | Lib/test/test_contains.py | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/Lib/test/test_contains.py b/Lib/test/test_contains.py index 3f0b234..622dfd4 100644 --- a/Lib/test/test_contains.py +++ b/Lib/test/test_contains.py @@ -20,19 +20,19 @@ class TestContains(unittest.TestCase): a = base_set(1) b = myset(1) c = seq(1) - self.assert_(1 in b) - self.assert_(0 not in b) - self.assert_(1 in c) - self.assert_(0 not in c) + self.assertTrue(1 in b) + self.assertTrue(0 not in b) + self.assertTrue(1 in c) + self.assertTrue(0 not in c) self.assertRaises(TypeError, lambda: 1 in a) self.assertRaises(TypeError, lambda: 1 not in a) # test char in string - self.assert_('c' in 'abc') - self.assert_('d' not in 'abc') + self.assertTrue('c' in 'abc') + self.assertTrue('d' not in 'abc') - self.assert_('' in '') - self.assert_('' in 'abc') + self.assertTrue('' in '') + self.assertTrue('' in 'abc') self.assertRaises(TypeError, lambda: None in 'abc') @@ -40,15 +40,15 @@ class TestContains(unittest.TestCase): # a collection of tests on builtin sequence types a = range(10) for i in a: - self.assert_(i in a) - self.assert_(16 not in a) - self.assert_(a not in a) + self.assertTrue(i in a) + self.assertTrue(16 not in a) + self.assertTrue(a not in a) a = tuple(a) for i in a: - self.assert_(i in a) - self.assert_(16 not in a) - self.assert_(a not in a) + self.assertTrue(i in a) + self.assertTrue(16 not in a) + self.assertTrue(a not in a) class Deviant1: """Behaves strangely when compared @@ -64,7 +64,7 @@ class TestContains(unittest.TestCase): self.aList.remove(14) return 0 - self.assert_(Deviant1() not in Deviant1.aList) + self.assertTrue(Deviant1() not in Deviant1.aList) def test_nonreflexive(self): # containment and equality tests involving elements that are @@ -81,9 +81,9 @@ class TestContains(unittest.TestCase): for constructor in constructors: container = constructor(values) for elem in container: - self.assert_(elem in container) - self.assert_(container == constructor(values)) - self.assert_(container == container) + self.assertTrue(elem in container) + self.assertTrue(container == constructor(values)) + self.assertTrue(container == container) def test_main(): |