mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
use assert[Not]In where appropriate
A patch from Dave Malcolm.
This commit is contained in:
parent
a69ba65fdc
commit
577473fe68
75 changed files with 471 additions and 454 deletions
|
@ -24,11 +24,11 @@ class TestGdbm(unittest.TestCase):
|
|||
self.g[b'bytes'] = b'data'
|
||||
key_set = set(self.g.keys())
|
||||
self.assertEqual(key_set, set([b'a', b'bytes', b'12345678910']))
|
||||
self.assertTrue(b'a' in self.g)
|
||||
self.assertIn(b'a', self.g)
|
||||
self.assertEqual(self.g[b'bytes'], b'data')
|
||||
key = self.g.firstkey()
|
||||
while key:
|
||||
self.assertTrue(key in key_set)
|
||||
self.assertIn(key, key_set)
|
||||
key_set.remove(key)
|
||||
key = self.g.nextkey(key)
|
||||
self.assertRaises(KeyError, lambda: self.g['xxx'])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue