diff --git a/rhodecode/lib/hooks.py b/rhodecode/lib/hooks.py --- a/rhodecode/lib/hooks.py +++ b/rhodecode/lib/hooks.py @@ -24,7 +24,6 @@ # along with this program. If not, see . import os import sys -import getpass from mercurial.scmutil import revrange from mercurial.node import nullrev diff --git a/rhodecode/lib/utils.py b/rhodecode/lib/utils.py --- a/rhodecode/lib/utils.py +++ b/rhodecode/lib/utils.py @@ -494,27 +494,9 @@ def create_test_env(repos_test_path, con HG_FORK, GIT_FORK, TESTS_TMP_PATH import tarfile import shutil - from os.path import dirname as dn, join as jn, abspath - - log = logging.getLogger('TestEnvCreator') - # create logger - log.setLevel(logging.DEBUG) - log.propagate = True - # create console handler and set level to debug - ch = logging.StreamHandler() - ch.setLevel(logging.DEBUG) + from os.path import abspath - # create formatter - formatter = logging.Formatter("%(asctime)s - %(name)s -" - " %(levelname)s - %(message)s") - - # add formatter to ch - ch.setFormatter(formatter) - - # add ch to logger - log.addHandler(ch) - - #PART ONE create db + # PART ONE create db dbconf = config['sqlalchemy.db1.url'] log.debug('making test db %s', dbconf) @@ -532,16 +514,9 @@ def create_test_env(repos_test_path, con dbmanage.create_permissions() dbmanage.populate_default_permissions() - #PART TWO make test repo + # PART TWO make test repo log.debug('making test vcs repositories') - #remove old one from previos tests - for r in [HG_REPO, GIT_REPO, NEW_HG_REPO, NEW_GIT_REPO, HG_FORK, GIT_FORK]: - - if os.path.isdir(jn(TESTS_TMP_PATH, r)): - log.debug('removing %s', r) - shutil.rmtree(jn(TESTS_TMP_PATH, r)) - idx_path = config['app_conf']['index_dir'] data_path = config['app_conf']['cache_dir'] diff --git a/rhodecode/tests/__init__.py b/rhodecode/tests/__init__.py --- a/rhodecode/tests/__init__.py +++ b/rhodecode/tests/__init__.py @@ -27,19 +27,22 @@ log = logging.getLogger(__name__) import pylons.test __all__ = ['environ', 'url', 'TestController', 'TESTS_TMP_PATH', 'HG_REPO', - 'GIT_REPO', 'NEW_HG_REPO', 'NEW_GIT_REPO', 'HG_FORK', 'GIT_FORK', ] + 'GIT_REPO', 'NEW_HG_REPO', 'NEW_GIT_REPO', 'HG_FORK', 'GIT_FORK', + 'TEST_USER_ADMIN_LOGIN', 'TEST_USER_ADMIN_PASS' ] # Invoke websetup with the current config file #SetupCommand('setup-app').run([config_file]) ##RUNNING DESIRED TESTS -#nosetests -x rhodecode.tests.functional.test_admin_settings:TestSettingsController.test_my_account - +# nosetests -x rhodecode.tests.functional.test_admin_settings:TestSettingsController.test_my_account +# nosetests --pdb --pdb-failures environ = {} #SOME GLOBALS FOR TESTS from tempfile import _RandomNameSequence TESTS_TMP_PATH = jn('/', 'tmp', 'rc_test_%s' % _RandomNameSequence().next()) +TEST_USER_ADMIN_LOGIN = 'test_admin' +TEST_USER_ADMIN_PASS = 'test12' HG_REPO = 'vcs_test_hg' GIT_REPO = 'vcs_test_git' @@ -61,7 +64,8 @@ class TestController(TestCase): self.index_location = config['app_conf']['index_dir'] TestCase.__init__(self, *args, **kwargs) - def log_user(self, username='test_admin', password='test12'): + def log_user(self, username=TEST_USER_ADMIN_LOGIN, + password=TEST_USER_ADMIN_PASS): response = self.app.post(url(controller='login', action='index'), {'username':username, 'password':password}) diff --git a/rhodecode/tests/test_libs.py b/rhodecode/tests/test_libs.py --- a/rhodecode/tests/test_libs.py +++ b/rhodecode/tests/test_libs.py @@ -4,7 +4,7 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~ - Package for testing varios lib/helper functions in rhodecode + Package for testing various lib/helper functions in rhodecode :created_on: Jun 9, 2011 :copyright: (c) 2011 by marcink. @@ -16,7 +16,6 @@ import unittest from rhodecode.tests import * - proto = 'http' TEST_URLS = [ ('%s://127.0.0.1' % proto, ['%s://' % proto, '127.0.0.1'], diff --git a/setup.cfg b/setup.cfg --- a/setup.cfg +++ b/setup.cfg @@ -6,10 +6,11 @@ tag_svn_revision = true find_links = http://www.pylonshq.com/download/ [nosetests] -verbose=True +verbose=False verbosity=2 with-pylons=test.ini -detailed-errors=1 +detailed-errors=0 +nologcapture=1 # Babel configuration [compile_catalog]