def test_cpl_debug_true(tmpdir):
    """Setting CPL_DEBUG=True results in GDAL debug messages."""
    log = logging.getLogger('rasterio._gdal')
    log.setLevel(logging.DEBUG)
    logfile = str(tmpdir.join('test.log'))
    fh = logging.FileHandler(logfile)
    log.addHandler(fh)

    with Env(CPL_DEBUG=True):
        with rasterio.open("tests/data/RGB.byte.tif"):
            pass

    log = open(logfile).read()
    assert "GDAL: GDALOpen(tests/data/RGB.byte.tif" in log
dataset/ETHPy150Open mapbox/rasterio/tests/test_driver_management.py/test_cpl_debug_true/original