From fe3421415e912c6f5349d342e66e858ce158cc6d Mon Sep 17 00:00:00 2001 From: CyclingNinja Date: Thu, 30 May 2024 10:01:50 +0100 Subject: [PATCH] Test adjustments --- glue/main.py | 2 +- glue/tests/test_main.py | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/glue/main.py b/glue/main.py index 63fa2b279..d32aca234 100644 --- a/glue/main.py +++ b/glue/main.py @@ -59,7 +59,7 @@ def load_plugins(splash=None, require_qt_plugins=False, plugins_to_load=None): n_plugins = len(plugins_to_require) for i_plugin, item in enumerate(list(iter_plugin_entry_points())): - if item.module in plugins_to_require: + if item.module in plugins_to_load: if item.module not in _installed_plugins: _installed_plugins.add(item.name) diff --git a/glue/tests/test_main.py b/glue/tests/test_main.py index 4744005e4..7d4c83744 100644 --- a/glue/tests/test_main.py +++ b/glue/tests/test_main.py @@ -13,8 +13,13 @@ def test_load_plugins(capsys): with patch.object(logger, 'info') as info: load_plugins() - plugin = [call[0][0] for call in info.call_args_list] - assert False + # plugins = [call[0][0] for call in info.call_args_list if ('succeeded' or 'loaded') in call[0][0]] + plugins = [] + for acall in info.call_args_list: + if ('loaded' or 'succeeded') in acall[0][0]: + plugins.append(acall[0][0]) + + assert len(plugins) == 5 def test_no_duplicate_loading(capsys): @@ -41,4 +46,4 @@ def test_list_plugins(): load_plugins(require_qt_plugins=False) plugins = list_plugins() assert isinstance(plugins, list) - assert len(plugins) == 14 + assert len(plugins) == 5