(self)
| 512 | "failed for {}: {} != 0".format(n, rawio._extraneous_reads)) |
| 513 | |
| 514 | def test_read_on_closed(self): |
| 515 | # Issue #23796 |
| 516 | b = self.BufferedReader(self.BytesIO(b"12")) |
| 517 | b.read(1) |
| 518 | b.close() |
| 519 | with self.subTest('peek'): |
| 520 | self.assertRaises(ValueError, b.peek) |
| 521 | with self.subTest('read1'): |
| 522 | self.assertRaises(ValueError, b.read1, 1) |
| 523 | with self.subTest('read'): |
| 524 | self.assertRaises(ValueError, b.read) |
| 525 | with self.subTest('readinto'): |
| 526 | self.assertRaises(ValueError, b.readinto, bytearray()) |
| 527 | with self.subTest('readinto1'): |
| 528 | self.assertRaises(ValueError, b.readinto1, bytearray()) |
| 529 | with self.subTest('flush'): |
| 530 | self.assertRaises(ValueError, b.flush) |
| 531 | with self.subTest('truncate'): |
| 532 | self.assertRaises(ValueError, b.truncate) |
| 533 | with self.subTest('seek'): |
| 534 | self.assertRaises(ValueError, b.seek, 0) |
| 535 | |
| 536 | def test_truncate_on_read_only(self): |
| 537 | rawio = self.MockFileIO(b"abc") |
nothing calls this directly
no test coverage detected