code: def test_io_error(tmpdir):
      """RasterioIOError is raised when a disk file can't be opened.
      Newlines are removed from GDAL error messages."""
      with pytest.raises(RasterioIOError) as exc_info:
          rasterio.open(str(tmpdir.join("foo.tif")))
      (msg,) = exc_info.value.args
      assert "\n" not in msg
  
file_path: rasterio/tests/test_err.py
imports: import logging
  import pytest
  import rasterio
  from rasterio._err import CPLE_BaseError
  from rasterio.errors import RasterioIOError
  from rasterio.env import GDALVersion
  from .conftest import gdal_version
label_desc: Use image node_id 1 for calling a global function with example usage: test_io_error(tmpdir) without return types