diff --git a/tests/modules/module_test.py b/tests/modules/module_test.py index 5eda96a84f..c29297392a 100644 --- a/tests/modules/module_test.py +++ b/tests/modules/module_test.py @@ -28,18 +28,15 @@ def test_modules_test_no_name_no_prompts(self): assert "Tool name not provided and prompts deactivated." in str(excinfo.value) -def test_modules_test_no_proper_path(self): +def test_modules_test_no_installed_modules(self): """Test the check_inputs() function - raise UserWarning because installed modules were not found""" cwd = os.getcwd() - with pytest.raises(SystemError): - assert nf_core.modules.ModulesTest(".", False, "") - - -def test_modules_test_all_modules_listed(self): - """Test the check_inputs() function - raise UserWarning because installed modules were not found""" - cwd = os.getcwd() - meta_builder = nf_core.modules.ModulesTest(".", False, "") + os.chdir(self.nfcore_modules) + meta_builder = nf_core.modules.ModulesTest(None, False, "") + meta_builder.module_names["modules"] = None + meta_builder.repo_type = "modules" with pytest.raises(UserWarning) as excinfo: meta_builder._check_inputs() os.chdir(cwd) - assert "No installed modules were found." in str(excinfo.value) + print(excinfo.value) + assert "No installed modules were found" in str(excinfo.value) diff --git a/tests/test_modules.py b/tests/test_modules.py index 917f7989e2..d96b3b85f6 100644 --- a/tests/test_modules.py +++ b/tests/test_modules.py @@ -109,8 +109,8 @@ def test_modulesrepo_class(self): ) from .modules.module_test import ( test_modules_test_check_inputs, + test_modules_test_no_installed_modules, test_modules_test_no_name_no_prompts, - test_modules_test_no_proper_path, ) from .modules.remove import ( test_modules_remove_trimgalore,