summaryrefslogtreecommitdiffstats
path: root/Lib/test/seq_tests.py
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2010-01-23 23:04:36 (GMT)
committerEzio Melotti <ezio.melotti@gmail.com>2010-01-23 23:04:36 (GMT)
commitaa98058cc44ba20f35c106d20918c6196b737561 (patch)
tree317b6f7bf17df98e284d0902ae10a64faf4ccd91 /Lib/test/seq_tests.py
parent8cd0a66a0fd7bb7d69153906942930c2e8c3dd17 (diff)
downloadcpython-aa98058cc44ba20f35c106d20918c6196b737561.zip
cpython-aa98058cc44ba20f35c106d20918c6196b737561.tar.gz
cpython-aa98058cc44ba20f35c106d20918c6196b737561.tar.bz2
use assert[Not]In where appropriate
Diffstat (limited to 'Lib/test/seq_tests.py')
-rw-r--r--Lib/test/seq_tests.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/test/seq_tests.py b/Lib/test/seq_tests.py
index 14303aa..cf3ae8e 100644
--- a/Lib/test/seq_tests.py
+++ b/Lib/test/seq_tests.py
@@ -201,9 +201,9 @@ class CommonTest(unittest.TestCase):
def test_contains(self):
u = self.type2test([0, 1, 2])
for i in u:
- self.assert_(i in u)
+ self.assertIn(i, u)
for i in min(u)-1, max(u)+1:
- self.assert_(i not in u)
+ self.assertNotIn(i, u)
self.assertRaises(TypeError, u.__contains__)
@@ -215,8 +215,8 @@ class CommonTest(unittest.TestCase):
def __eq__(self, other):
return True
__hash__ = None # Can't meet hash invariant requirements
- self.assert_(AllEq() not in self.type2test([]))
- self.assert_(AllEq() in self.type2test([1]))
+ self.assertNotIn(AllEq(), self.type2test([]))
+ self.assertIn(AllEq(), self.type2test([1]))
def test_contains_order(self):
# Sequences must test in-order. If a rich comparison has side
@@ -229,7 +229,7 @@ class CommonTest(unittest.TestCase):
raise DoNotTestEq
checkfirst = self.type2test([1, StopCompares()])
- self.assert_(1 in checkfirst)
+ self.assertIn(1, checkfirst)
checklast = self.type2test([StopCompares(), 1])
self.assertRaises(DoNotTestEq, checklast.__contains__, 1)