You can just use StringIO here, like other tests do.