mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
use assert[Not]In where appropriate
This commit is contained in:
parent
0f77f465ff
commit
b58e0bd8bb
39 changed files with 176 additions and 173 deletions
|
@ -770,8 +770,8 @@ class AbstractPickleTests(unittest.TestCase):
|
|||
|
||||
# Dump using protocol 1 for comparison.
|
||||
s1 = self.dumps(x, 1)
|
||||
self.assertTrue(__name__.encode("utf-8") in s1)
|
||||
self.assertTrue(b"MyList" in s1)
|
||||
self.assertIn(__name__.encode("utf-8"), s1)
|
||||
self.assertIn(b"MyList", s1)
|
||||
self.assertEqual(opcode_in_pickle(opcode, s1), False)
|
||||
|
||||
y = self.loads(s1)
|
||||
|
@ -780,8 +780,8 @@ class AbstractPickleTests(unittest.TestCase):
|
|||
|
||||
# Dump using protocol 2 for test.
|
||||
s2 = self.dumps(x, 2)
|
||||
self.assertTrue(__name__.encode("utf-8") not in s2)
|
||||
self.assertTrue(b"MyList" not in s2)
|
||||
self.assertNotIn(__name__.encode("utf-8"), s2)
|
||||
self.assertNotIn(b"MyList", s2)
|
||||
self.assertEqual(opcode_in_pickle(opcode, s2), True, repr(s2))
|
||||
|
||||
y = self.loads(s2)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue