diff --git a/lib/galaxy/config/__init__.py b/lib/galaxy/config/__init__.py index 8a8d0fc9f5a..96c2a63023e 100644 --- a/lib/galaxy/config/__init__.py +++ b/lib/galaxy/config/__init__.py @@ -707,7 +707,6 @@ class GalaxyAppConfiguration(BaseAppConfiguration, CommonConfigurationMixin): def _override_tempdir(self, kwargs): if string_as_bool(kwargs.get("override_tempdir", "True")): - raise Exception("How did we get here ?") tempfile.tempdir = self.new_file_path def config_value_for_host(self, config_option, host): diff --git a/test/unit/config/test_config_dataset_storage.py b/test/unit/config/test_config_dataset_storage.py index 3b66482f11e..428e4968f0d 100644 --- a/test/unit/config/test_config_dataset_storage.py +++ b/test/unit/config/test_config_dataset_storage.py @@ -6,14 +6,14 @@ from galaxy.config import BaseAppConfiguration def test_object_store_store_by_set(): # object_store_store_by set by admin - appconfig = config.GalaxyAppConfiguration(object_store_store_by='id') + appconfig = config.GalaxyAppConfiguration(object_store_store_by='id', override_tempdir=False) assert appconfig.object_store_store_by == 'id' def test_uuid_1(): # object_store_store_by not set # file_path set by admin to `objects` (no need for the dir to exist) - appconfig = config.GalaxyAppConfiguration(file_path='objects') + appconfig = config.GalaxyAppConfiguration(file_path='objects', override_tempdir=False) assert appconfig.object_store_store_by == 'uuid' @@ -22,7 +22,7 @@ def test_uuid_2(monkeypatch): # object_store_store_by not set # file_path not set, `files` dir doesn't exist monkeypatch.setattr(BaseAppConfiguration, '_path_exists', lambda self, path: False) - appconfig = config.GalaxyAppConfiguration() + appconfig = config.GalaxyAppConfiguration(override_tempdir=False) assert appconfig.object_store_store_by == 'uuid' @@ -30,7 +30,7 @@ def test_uuid_2(monkeypatch): def test_id_1(): # object_store_store_by not set # file_path set by admin to `not_objects` (no need for the dir to exist) - appconfig = config.GalaxyAppConfiguration(file_path='not_objects') + appconfig = config.GalaxyAppConfiguration(file_path='not_objects', override_tempdir=False) assert appconfig.object_store_store_by == 'id' @@ -39,6 +39,6 @@ def test_id_2(monkeypatch): # object_store_store_by not set # file_path not set, `files` dir exists monkeypatch.setattr(BaseAppConfiguration, '_path_exists', lambda self, path: True if os.path.basename(path) == 'files' else False) - appconfig = config.GalaxyAppConfiguration() + appconfig = config.GalaxyAppConfiguration(override_tempdir=False) assert appconfig.object_store_store_by == 'id' diff --git a/test/unit/webapps/test_config_values.py b/test/unit/webapps/test_config_values.py index 24f922cee46..661752c9837 100644 --- a/test/unit/webapps/test_config_values.py +++ b/test/unit/webapps/test_config_values.py @@ -13,7 +13,7 @@ TestData = namedtuple('TestData', ('key', 'expected', 'loaded')) @pytest.fixture(scope='module') def appconfig(): - return config.GalaxyAppConfiguration() + return config.GalaxyAppConfiguration(override_tempdir=False) @pytest.fixture @@ -35,7 +35,7 @@ def test_common_base_config(appconfig): def test_base_config_if_running_from_source(monkeypatch, mock_config_file): # Simulated condition: running from source, config_file is None. monkeypatch.setattr(config, 'running_from_source', True) - appconfig = config.GalaxyAppConfiguration() + appconfig = config.GalaxyAppConfiguration(override_tempdir=False) assert not appconfig.config_file assert appconfig.config_dir == os.path.join(appconfig.root, 'config') assert appconfig.data_dir == os.path.join(appconfig.root, 'database') @@ -45,7 +45,7 @@ def test_base_config_if_running_from_source(monkeypatch, mock_config_file): def test_base_config_if_running_not_from_source(monkeypatch, mock_config_file): # Simulated condition: running not from source, config_file is None. monkeypatch.setattr(config, 'running_from_source', False) - appconfig = config.GalaxyAppConfiguration() + appconfig = config.GalaxyAppConfiguration(override_tempdir=False) assert not appconfig.config_file assert appconfig.config_dir == os.getcwd() assert appconfig.data_dir == os.path.join(appconfig.config_dir, 'data')