mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Issue #20557: Use specific asserts in io tests.
This commit is contained in:
parent
ce17f76475
commit
0dcd80a6c0
5 changed files with 20 additions and 18 deletions
|
@ -693,7 +693,8 @@ class CBytesIOTest(PyBytesIOTest):
|
|||
self.assertEqual(len(state), 3)
|
||||
bytearray(state[0]) # Check if state[0] supports the buffer interface.
|
||||
self.assertIsInstance(state[1], int)
|
||||
self.assertTrue(isinstance(state[2], dict) or state[2] is None)
|
||||
if state[2] is not None:
|
||||
self.assertIsInstance(state[2], dict)
|
||||
memio.close()
|
||||
self.assertRaises(ValueError, memio.__getstate__)
|
||||
|
||||
|
@ -749,7 +750,8 @@ class CStringIOTest(PyStringIOTest):
|
|||
self.assertIsInstance(state[0], str)
|
||||
self.assertIsInstance(state[1], str)
|
||||
self.assertIsInstance(state[2], int)
|
||||
self.assertTrue(isinstance(state[3], dict) or state[3] is None)
|
||||
if state[3] is not None:
|
||||
self.assertIsInstance(state[3], dict)
|
||||
memio.close()
|
||||
self.assertRaises(ValueError, memio.__getstate__)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue