summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_memoryio.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-08-02 12:18:28 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2015-08-02 12:18:28 (GMT)
commitb064f1e94f615ae6a9cfa2ce288b1b102dc9d870 (patch)
treefae2afe1a387622ddc77eb7195c061bdef493d01 /Lib/test/test_memoryio.py
parent13db76a9743f4a414339efb1cfd5b3365806e463 (diff)
parent0dcd80a6c06d0fa1b1250e33e868b196d6d80efc (diff)
downloadcpython-b064f1e94f615ae6a9cfa2ce288b1b102dc9d870.zip
cpython-b064f1e94f615ae6a9cfa2ce288b1b102dc9d870.tar.gz
cpython-b064f1e94f615ae6a9cfa2ce288b1b102dc9d870.tar.bz2
Issue #20557: Use specific asserts in io tests.
Diffstat (limited to 'Lib/test/test_memoryio.py')
-rw-r--r--Lib/test/test_memoryio.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/test/test_memoryio.py b/Lib/test/test_memoryio.py
index 3f9928b..df4ff7a 100644
--- a/Lib/test/test_memoryio.py
+++ b/Lib/test/test_memoryio.py
@@ -694,7 +694,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__)
@@ -794,7 +795,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__)