fix test with StringIO and check for "read" attribute even if input has
"__iter__" because of StringIO