summaryrefslogtreecommitdiff
path: root/Lib/test/test_dict.py
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2010-01-23 15:40:09 +0000
committerEzio Melotti <ezio.melotti@gmail.com>2010-01-23 15:40:09 +0000
commitb58e0bd8bb7592dd48b30af546fc20f52ac625bd (patch)
tree2af0b7f4177890e1781f8d38aed8ebdc44c71f39 /Lib/test/test_dict.py
parent0f77f465ff7f5e39bbf701b575aebf75dd8d800d (diff)
downloadcpython-git-b58e0bd8bb7592dd48b30af546fc20f52ac625bd.tar.gz
use assert[Not]In where appropriate
Diffstat (limited to 'Lib/test/test_dict.py')
-rw-r--r--Lib/test/test_dict.py9
1 files changed, 1 insertions, 8 deletions
diff --git a/Lib/test/test_dict.py b/Lib/test/test_dict.py
index 919fce8898..c04d7000e0 100644
--- a/Lib/test/test_dict.py
+++ b/Lib/test/test_dict.py
@@ -34,9 +34,7 @@ class DictTest(unittest.TestCase):
self.assertEqual(set(d.keys()), set())
d = {'a': 1, 'b': 2}
k = d.keys()
- self.assertTrue('a' in d)
self.assertIn('a', d)
- self.assertTrue('b' in d)
self.assertIn('b', d)
self.assertRaises(TypeError, d.keys, None)
self.assertEqual(repr(dict(a=1).keys()), "dict_keys(['a'])")
@@ -60,15 +58,12 @@ class DictTest(unittest.TestCase):
def test_contains(self):
d = {}
+ self.assertNotIn('a', d)
self.assertTrue(not ('a' in d))
self.assertTrue('a' not in d)
- self.assertNotIn('a', d)
d = {'a': 1, 'b': 2}
- self.assertTrue('a' in d)
self.assertIn('a', d)
- self.assertTrue('b' in d)
self.assertIn('b', d)
- self.assertTrue('c' not in d)
self.assertNotIn('c', d)
self.assertRaises(TypeError, d.__contains__)
@@ -524,9 +519,7 @@ class DictTest(unittest.TestCase):
d = D({1: 2, 3: 4})
self.assertEqual(d[1], 2)
self.assertEqual(d[3], 4)
- self.assertTrue(2 not in d)
self.assertNotIn(2, d)
- self.assertTrue(2 not in d.keys())
self.assertNotIn(2, d.keys())
self.assertEqual(d[2], 42)
class E(dict):