From 651c629f66d1c8043c38e1c772f587423e5c6807 Mon Sep 17 00:00:00 2001 From: nf-core_bot Date: Tue, 23 Aug 2022 11:57:01 +0200 Subject: [PATCH] fix error due to changed working directory --- tests/modules/lint.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/modules/lint.py b/tests/modules/lint.py index e0aafaab7f..d5793dfd05 100644 --- a/tests/modules/lint.py +++ b/tests/modules/lint.py @@ -62,10 +62,15 @@ def test_modules_lint_patched_modules(self): # Create a patch file patch_obj = nf_core.modules.ModulePatch(self.pipeline_dir, GITLAB_URL, PATCH_BRANCH) patch_obj.patch(BISMARK_ALIGN) - # change directory to the module directory + + # change temporarily working directory to the pipeline directory + # to avoid error from try_apply_patch() during linting + wd_old = os.getcwd() os.chdir(self.pipeline_dir) module_lint = nf_core.modules.ModuleLint(dir=self.pipeline_dir, remote_url=GITLAB_URL) module_lint.lint(print_results=False, all_modules=True) + os.chdir(wd_old) + assert len(module_lint.failed) == 0 assert len(module_lint.passed) > 0 assert len(module_lint.warned) >= 0