@pytest.fixture
def ts_directory(po_directory, request, tmpdir, settings):
 import pytest_pootle
 from pootle_store.models import fs
 ts_dir = str(tmpdir.mkdir('ts'))
 settings.POOTLE_TRANSLATION_DIRECTORY = ts_dir
 fs.location = ts_dir
 shutil.copytree(os.path.join(os.path.dirname(pytest_pootle.__file__), 'data', 'ts', 'tutorial'), os.path.join(settings.POOTLE_TRANSLATION_DIRECTORY, 'tutorial'))
 def _cleanup():
  for f in tmpdir.listdir():
   f.remove()
 request.addfinalizer(_cleanup)
 return settings.POOTLE_TRANSLATION_DIRECTORY

@ pytest . fixture def ts_directory ( po_directory , request , tmpdir , settings ) : import pytest_pootle from pootle_store . models import fs ts_dir = str ( tmpdir . mkdir ( 'ts' ) ) settings . POOTLE_TRANSLATION_DIRECTORY = ts_dir fs . location = ts_dir shutil . copytree ( os . path . join ( os . path . dirname ( pytest_pootle . __file__ ) , 'data' , 'ts' , 'tutorial' ) , os . path . join ( settings . POOTLE_TRANSLATION_DIRECTORY , 'tutorial' ) ) def _cleanup ( ) : for f in tmpdir . listdir ( ) : f . remove ( ) request . addfinalizer ( _cleanup ) return settings . POOTLE_TRANSLATION_DIRECTORY
sets up a tmp directory for ts files .