# HG changeset patch # User Mads Kiilerich # Date 2017-05-28 19:42:23 # Node ID f0705609e494461fb1611581ff6ddf8dd7733d3e # Parent 6452215a54ee786d65cf96131dfc135a081f274a tests: drop 'environ' as global variable - just pass it to URLGenerator as temporary variable HTTP_HOST is mandatory - specify it as 'example.com'. diff --git a/kallithea/tests/base.py b/kallithea/tests/base.py --- a/kallithea/tests/base.py +++ b/kallithea/tests/base.py @@ -39,7 +39,7 @@ url = None testapp = None __all__ = [ - 'skipif', 'parametrize', 'environ', 'url', 'TestController', + 'skipif', 'parametrize', 'url', 'TestController', 'ldap_lib_installed', 'pam_lib_installed', 'invalidate_all_caches', 'TESTS_TMP_PATH', 'HG_REPO', 'GIT_REPO', 'NEW_HG_REPO', 'NEW_GIT_REPO', 'HG_FORK', 'GIT_FORK', 'TEST_USER_ADMIN_LOGIN', 'TEST_USER_ADMIN_PASS', @@ -54,8 +54,6 @@ __all__ = [ # Invoke websetup with the current config file # SetupCommand('setup-app').run([config_file]) -environ = {} - #SOME GLOBALS FOR TESTS TESTS_TMP_PATH = os.path.join(tempfile.gettempdir(), 'rc_test_%s' % tempfile._RandomNameSequence().next()) diff --git a/kallithea/tests/conftest.py b/kallithea/tests/conftest.py --- a/kallithea/tests/conftest.py +++ b/kallithea/tests/conftest.py @@ -55,7 +55,7 @@ def pytest_configure(): logging.disable(logging.NOTSET) - kallithea.tests.base.url = URLGenerator(RootController().mapper, kallithea.tests.base.environ) + kallithea.tests.base.url = URLGenerator(RootController().mapper, {'HTTP_HOST': 'example.com'}) @pytest.fixture