Use readlines on StringIO. Ensure quiet_context returns rewound buffers.