Skip to content

Commit

Permalink
fix pytests
Browse files Browse the repository at this point in the history
  • Loading branch information
mirpedrol committed Jul 1, 2022
1 parent 3dbfe92 commit 0b06097
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
17 changes: 7 additions & 10 deletions tests/modules/module_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion tests/test_modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 0b06097

Please sign in to comment.