summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_memoryio.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-08-02 12:17:49 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2015-08-02 12:17:49 (GMT)
commit0dcd80a6c06d0fa1b1250e33e868b196d6d80efc (patch)
tree1a50131cf0cd83f1899ce13aed21ed8d045a767e /Lib/test/test_memoryio.py
parentce17f764757306cdcdf1555c67dd0eed8e6bca8a (diff)
downloadcpython-0dcd80a6c06d0fa1b1250e33e868b196d6d80efc.zip
cpython-0dcd80a6c06d0fa1b1250e33e868b196d6d80efc.tar.gz
cpython-0dcd80a6c06d0fa1b1250e33e868b196d6d80efc.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 9a2461d..7ce95b9 100644
--- a/Lib/test/test_memoryio.py
+++ b/Lib/test/test_memoryio.py
@@ -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__)