diff options
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): |