def METHOD_NAME(self):
    gen = self.reader.read_to_eof(2)
    self.reader.feed_data(b"spam")
    with self.assertRaises(RuntimeError) as raised:
        next(gen)
    self.assertEqual(
        str(raised.exception),
        "read 4 bytes, expected no more than 2 bytes",
    )