@pytest.fixture
def temp_basedir_env(tmpdir, short_tmpdir):
 data_dir = (tmpdir / 'data')
 config_dir = (tmpdir / 'config')
 runtime_dir = (short_tmpdir / 'rt')
 cache_dir = (tmpdir / 'cache')
 runtime_dir.ensure(dir=True)
 runtime_dir.chmod(448)
 ((data_dir / 'qutebrowser') / 'state').write_text('[general]\nquickstart-done = 1', encoding='utf-8', ensure=True)
 env = {'XDG_DATA_HOME': str(data_dir), 'XDG_CONFIG_HOME': str(config_dir), 'XDG_RUNTIME_DIR': str(runtime_dir), 'XDG_CACHE_HOME': str(cache_dir)}
 return env

@ pytest . fixture def temp_basedir_env ( tmpdir , short_tmpdir ) : data_dir = ( tmpdir / 'data' ) config_dir = ( tmpdir / 'config' ) runtime_dir = ( short_tmpdir / 'rt' ) cache_dir = ( tmpdir / 'cache' ) runtime_dir . ensure ( dir = True ) runtime_dir . chmod ( 448 ) ( ( data_dir / 'qutebrowser' ) / 'state' ) . write_text ( '[general]\nquickstart-done = 1' , encoding = 'utf-8' , ensure = True ) env = { 'XDG_DATA_HOME' : str ( data_dir ) , 'XDG_CONFIG_HOME' : str ( config_dir ) , 'XDG_RUNTIME_DIR' : str ( runtime_dir ) , 'XDG_CACHE_HOME' : str ( cache_dir ) } return env
return a dict of environment variables that fakes --temp-basedir .