(self)
| 4404 | self.assertNotIsInstance(C(), ReleasableBuffer) |
| 4405 | |
| 4406 | def test_io_reader_protocol_allowed(self): |
| 4407 | @runtime_checkable |
| 4408 | class CustomReader(io.Reader[bytes], Protocol): |
| 4409 | def close(self): ... |
| 4410 | |
| 4411 | class A: pass |
| 4412 | class B: |
| 4413 | def read(self, sz=-1): |
| 4414 | return b"" |
| 4415 | def close(self): |
| 4416 | pass |
| 4417 | |
| 4418 | self.assertIsSubclass(B, CustomReader) |
| 4419 | self.assertIsInstance(B(), CustomReader) |
| 4420 | self.assertNotIsSubclass(A, CustomReader) |
| 4421 | self.assertNotIsInstance(A(), CustomReader) |
| 4422 | |
| 4423 | def test_io_writer_protocol_allowed(self): |
| 4424 | @runtime_checkable |
nothing calls this directly
no test coverage detected