<s> import logging <EOL> import sys <EOL> import rasterio <EOL> from rasterio . _drivers import driver_count <EOL> from rasterio . env import Env <EOL> def test_drivers ( ) : <EOL> with Env ( ) as m : <EOL> assert driver_count ( ) > <NUM_LIT:0> <EOL> assert type ( m ) == Env <EOL> assert driver_count ( ) > <NUM_LIT:0> <EOL> def test_drivers_bwd_compat ( ) : <EOL> with rasterio . drivers ( ) as m : <EOL> assert driver_count ( ) > <NUM_LIT:0> <EOL> assert type ( m ) == Env <EOL> assert driver_count ( ) > <NUM_LIT:0> <EOL> def test_cpl_debug_true ( tmpdir ) : <EOL> """<STR_LIT>""" <EOL> log = logging . getLogger ( '<STR_LIT>' ) <EOL> log . setLevel ( logging . DEBUG ) <EOL> logfile = str ( tmpdir . join ( '<STR_LIT>' ) ) <EOL> fh = logging . FileHandler ( logfile ) <EOL> log . addHandler ( fh ) <EOL> with Env ( CPL_DEBUG = True ) : <EOL> with rasterio . open ( "<STR_LIT>" ) : <EOL> pass <EOL> log = open ( logfile ) . read ( ) <EOL> assert "<STR_LIT>" in log <EOL> def test_cpl_debug_false ( tmpdir ) : <EOL> """<STR_LIT>""" <EOL> log = logging . getLogger ( '<STR_LIT>' ) <EOL> log . setLevel ( logging . DEBUG ) <EOL> logfile = str ( tmpdir . join ( '<STR_LIT>' ) ) <EOL> fh = logging . FileHandler ( logfile ) <EOL> log . addHandler ( fh ) <EOL> with Env ( CPL_DEBUG = False ) : <EOL> with rasterio . open ( "<STR_LIT>" ) : <EOL> pass <EOL> log = open ( logfile ) . read ( ) <EOL> assert "<STR_LIT>" not in log </s>
