diff options
Diffstat (limited to 'Lib/test/test_memoryio.py')
-rw-r--r-- | Lib/test/test_memoryio.py | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/Lib/test/test_memoryio.py b/Lib/test/test_memoryio.py index 812db4cfa8c..55b693e5647 100644 --- a/Lib/test/test_memoryio.py +++ b/Lib/test/test_memoryio.py @@ -399,7 +399,16 @@ class MemoryTestMixin: del __main__.PickleTestMemIO -class BytesIOMixin: +class PyBytesIOTest(MemoryTestMixin, MemorySeekTestMixin, unittest.TestCase): + # Test _pyio.BytesIO; class also inherited for testing C implementation + + UnsupportedOperation = pyio.UnsupportedOperation + + @staticmethod + def buftype(s): + return s.encode("ascii") + ioclass = pyio.BytesIO + EOF = b"" def test_getbuffer(self): memio = self.ioclass(b"1234567890") @@ -426,18 +435,6 @@ class BytesIOMixin: memio.close() self.assertRaises(ValueError, memio.getbuffer) - -class PyBytesIOTest(MemoryTestMixin, MemorySeekTestMixin, - BytesIOMixin, unittest.TestCase): - - UnsupportedOperation = pyio.UnsupportedOperation - - @staticmethod - def buftype(s): - return s.encode("ascii") - ioclass = pyio.BytesIO - EOF = b"" - def test_read1(self): buf = self.buftype("1234567890") memio = self.ioclass(buf) |