mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
use assert[Not]In where appropriate
This commit is contained in:
parent
8cd0a66a0f
commit
aa98058cc4
86 changed files with 622 additions and 599 deletions
|
|
@ -21,9 +21,9 @@ class DbmTestCase(unittest.TestCase):
|
|||
self.d[k] = v
|
||||
self.assertEqual(sorted(self.d.keys()), sorted(k for (k, v) in a))
|
||||
for k, v in a:
|
||||
self.assertTrue(k in self.d)
|
||||
self.assertIn(k, self.d)
|
||||
self.assertEqual(self.d[k], v)
|
||||
self.assertTrue('xxx' not in self.d)
|
||||
self.assertNotIn('xxx', self.d)
|
||||
self.assertRaises(KeyError, lambda: self.d['xxx'])
|
||||
self.d.close()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue