diff --git a/rhodecode/lib/utils.py b/rhodecode/lib/utils.py --- a/rhodecode/lib/utils.py +++ b/rhodecode/lib/utils.py @@ -460,6 +460,7 @@ def create_test_env(repos_test_path, con import tarfile import shutil from os.path import dirname as dn, join as jn, abspath + from rhodecode.tests import REPO_PATH, NEW_REPO_PATH log = logging.getLogger('TestEnvCreator') # create logger @@ -493,8 +494,12 @@ def create_test_env(repos_test_path, con #PART TWO make test repo log.debug('making test vcs repo') - if os.path.isdir('/tmp/vcs_test'): - shutil.rmtree('/tmp/vcs_test') + if os.path.isdir(REPO_PATH): + log.debug('REMOVING %s', REPO_PATH) + shutil.rmtree(REPO_PATH) + if os.path.isdir(NEW_REPO_PATH): + log.debug('REMOVING %s', NEW_REPO_PATH) + shutil.rmtree(NEW_REPO_PATH) cur_dir = dn(dn(abspath(__file__))) tar = tarfile.open(jn(cur_dir, 'tests', "vcs_test.tar.gz"))