From ce2818ebe0dc5f19a862dd1ce222af8563a357df Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Sun, 13 Dec 2009 16:22:10 -0500 Subject: The test suite has to be able to inhibit the loading of any configuration files. --- src/mailman/core/initialize.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/mailman/core/initialize.py') diff --git a/src/mailman/core/initialize.py b/src/mailman/core/initialize.py index 39a6ab078..81938613e 100644 --- a/src/mailman/core/initialize.py +++ b/src/mailman/core/initialize.py @@ -32,6 +32,7 @@ __all__ = [ 'initialize_1', 'initialize_2', 'initialize_3', + 'INHIBIT_CONFIG_FILE', ] @@ -48,6 +49,11 @@ import mailman.core.logging from mailman.interfaces.database import IDatabase from mailman.utilities.modules import call_name +# The test infrastructure uses this to prevent the search and loading of any +# existing configuration file. Otherwise the existence of say a +# ~/.mailman.cfg file can break tests. +INHIBIT_CONFIG_FILE = object() + def search_for_configuration_file(): @@ -109,6 +115,9 @@ def initialize_1(config_path=None, propagate_logs=None): # configuration file is searched for in the file system. if config_path is None: config_path = search_for_configuration_file() + elif config_path is INHIBIT_CONFIG_FILE: + # For the test suite, force this back to not using a config file. + config_path = None mailman.config.config.load(config_path) # Create the queue and log directories if they don't already exist. mailman.config.config.ensure_directories_exist() -- cgit v1.2.3-70-g09d2