summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_contains.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2009-08-13 08:51:18 (GMT)
committerGeorg Brandl <georg@python.org>2009-08-13 08:51:18 (GMT)
commitab91fdef1f1e556203a2eee98ba7d379e4790de9 (patch)
tree6f8f00dc18cc5f2801a675df277c2c595eb85ec8 /Lib/test/test_contains.py
parentef82be368abdea8e8032500e7ecc3a22f5f07851 (diff)
downloadcpython-ab91fdef1f1e556203a2eee98ba7d379e4790de9.zip
cpython-ab91fdef1f1e556203a2eee98ba7d379e4790de9.tar.gz
cpython-ab91fdef1f1e556203a2eee98ba7d379e4790de9.tar.bz2
Merged revisions 73715 via svnmerge from
svn+ssh://svn.python.org/python/branches/py3k ........ r73715 | benjamin.peterson | 2009-07-01 01:06:06 +0200 (Mi, 01 Jul 2009) | 1 line convert old fail* assertions to assert* ........
Diffstat (limited to 'Lib/test/test_contains.py')
-rw-r--r--Lib/test/test_contains.py36
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():