def test_settings():
 env.testval = 'outer value'
 with settings(testval='inner value'):
  eq_(env.testval, 'inner value')
 eq_(env.testval, 'outer value')

def test_settings ( ) : env . testval = 'outer value' with settings ( testval = 'inner value' ) : eq_ ( env . testval , 'inner value' ) eq_ ( env . testval , 'outer value' )
settings() should temporarily override env dict with given key/value pair .