(self)
| 1411 | |
| 1412 | @unittest.skipUnless(hasattr(os, "pipe"), "requires os.pipe()") |
| 1413 | def test_read_non_blocking(self): |
| 1414 | import os |
| 1415 | r, w = os.pipe() |
| 1416 | try: |
| 1417 | os.set_blocking(r, False) |
| 1418 | with self.io.open(r, 'rt') as textfile: |
| 1419 | r = None |
| 1420 | # Nothing has been written so a non-blocking read raises a BlockingIOError exception. |
| 1421 | with self.assertRaises(BlockingIOError): |
| 1422 | textfile.read() |
| 1423 | finally: |
| 1424 | if r is not None: |
| 1425 | os.close(r) |
| 1426 | os.close(w) |
| 1427 | |
| 1428 | |
| 1429 | class MemviewBytesIO(io.BytesIO): |
nothing calls this directly
no test coverage detected