def cleanup_directory(tempdir):
 skip_cleanup = (('GALAXY_TEST_NO_CLEANUP' in os.environ) or ('TOOL_SHED_TEST_NO_CLEANUP' in os.environ))
 if skip_cleanup:
  log.info(('GALAXY_TEST_NO_CLEANUP is on. Temporary files in %s' % tempdir))
  return
 try:
  if (os.path.exists(tempdir) and skip_cleanup):
   shutil.rmtree(tempdir)
 except Exception:
  pass

def cleanup_directory ( tempdir ) : skip_cleanup = ( ( 'GALAXY_TEST_NO_CLEANUP' in os . environ ) or ( 'TOOL_SHED_TEST_NO_CLEANUP' in os . environ ) ) if skip_cleanup : log . info ( ( 'GALAXY_TEST_NO_CLEANUP is on. Temporary files in %s' % tempdir ) ) return try : if ( os . path . exists ( tempdir ) and skip_cleanup ) : shutil . rmtree ( tempdir ) except Exception : pass
clean up temporary files used by test unless galaxy_test_no_cleanup is set .