diff options
author | Benjamin Peterson <benjamin@python.org> | 2010-01-19 00:09:57 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2010-01-19 00:09:57 (GMT) |
commit | 577473fe687b38c8f01b0c372d6d2563680045b3 (patch) | |
tree | ee7dc210c7c5281cf07add09a9cb451758e91716 /Lib/test/test_userdict.py | |
parent | a69ba65fdce3be6f55634b47cc56cf1f962f6cbc (diff) | |
download | cpython-577473fe687b38c8f01b0c372d6d2563680045b3.zip cpython-577473fe687b38c8f01b0c372d6d2563680045b3.tar.gz cpython-577473fe687b38c8f01b0c372d6d2563680045b3.tar.bz2 |
use assert[Not]In where appropriate
A patch from Dave Malcolm.
Diffstat (limited to 'Lib/test/test_userdict.py')
-rw-r--r-- | Lib/test/test_userdict.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/test/test_userdict.py b/Lib/test/test_userdict.py index 9d0a8b1..39dd196 100644 --- a/Lib/test/test_userdict.py +++ b/Lib/test/test_userdict.py @@ -95,7 +95,7 @@ class UserDictTest(mapping_tests.TestHashMappingProtocol): # Test "in". for i in u2.keys(): - self.assertTrue(i in u2) + self.assertIn(i, u2) self.assertEqual(i in u1, i in d1) self.assertEqual(i in u0, i in d0) @@ -122,7 +122,7 @@ class UserDictTest(mapping_tests.TestHashMappingProtocol): # Test setdefault t = collections.UserDict() self.assertEqual(t.setdefault("x", 42), 42) - self.assertTrue("x" in t) + self.assertIn("x", t) self.assertEqual(t.setdefault("x", 23), 42) # Test pop @@ -152,8 +152,8 @@ class UserDictTest(mapping_tests.TestHashMappingProtocol): d = D({1: 2, 3: 4}) self.assertEqual(d[1], 2) self.assertEqual(d[3], 4) - self.assertTrue(2 not in d) - self.assertTrue(2 not in d.keys()) + self.assertNotIn(2, d) + self.assertNotIn(2, d.keys()) self.assertEqual(d[2], 42) class E(collections.UserDict): def __missing__(self, key): |