MCPcopy Index your code
hub / github.com/python/cpython / Misbehaved

Class Misbehaved

Lib/test/test_io/test_general.py:599–603  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

597 # Make sure a `.readinto` call which returns a value outside
598 # (0, len(buffer)) raises.
599 class Misbehaved(self.io.RawIOBase):
600 def __init__(self, readinto_return) -> None:
601 self._readinto_return = readinto_return
602 def readinto(self, b):
603 return self._readinto_return
604
605 with self.assertRaises(ValueError) as cm:
606 Misbehaved(2).read(1)

Calls

no outgoing calls

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…