mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
More cleanup. Renamed BlockingIO to BlockingIOError.
Removed unused _PyFileIO class. Changed inheritance structure. TODO: do the same kinds of things to TextIO.
This commit is contained in:
parent
ebea9beab3
commit
141f767d46
2 changed files with 355 additions and 310 deletions
|
@ -64,7 +64,7 @@ class MockNonBlockWriterIO(io.RawIOBase):
|
|||
self._write_stack.append(b[:])
|
||||
n = self.bs.pop(0)
|
||||
if (n < 0):
|
||||
raise io.BlockingIO(0, "test blocking", -n)
|
||||
raise io.BlockingIOError(0, "test blocking", -n)
|
||||
else:
|
||||
return n
|
||||
|
||||
|
@ -145,20 +145,6 @@ class IOTest(unittest.TestCase):
|
|||
self.read_ops(f)
|
||||
f.close()
|
||||
|
||||
def test_PyFileIO(self):
|
||||
f = io._PyFileIO(test_support.TESTFN, "w")
|
||||
self.assertEqual(f.readable(), False)
|
||||
self.assertEqual(f.writable(), True)
|
||||
self.assertEqual(f.seekable(), True)
|
||||
self.write_ops(f)
|
||||
f.close()
|
||||
f = io._PyFileIO(test_support.TESTFN, "r")
|
||||
self.assertEqual(f.readable(), True)
|
||||
self.assertEqual(f.writable(), False)
|
||||
self.assertEqual(f.seekable(), True)
|
||||
self.read_ops(f)
|
||||
f.close()
|
||||
|
||||
|
||||
class MemorySeekTestMixin:
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue