Skip to content

Commit

Permalink
match how error was raised before
Browse files Browse the repository at this point in the history
  • Loading branch information
branfosj committed Apr 17, 2024
1 parent 768c890 commit 94f5f41
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions test/easyblocks/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@ def det_path_for_import(module, pythonpath=None):

cmd = cmd_tmpl % {'mod': module}

res = run_shell_cmd(cmd)
res = run_shell_cmd(cmd, hidden=True, fail_on_error=False)

if res.exit_code:
raise EasyBuildError(res.output)

# only return last line that should contain path to imported module
# warning messages may precede it
Expand Down Expand Up @@ -134,7 +137,7 @@ def write_module(path, txt):
self.assertTrue(os.path.samefile(easyblocks_path, parent_path), msg)

# importing EB_R class from easybuild.easyblocks.r works fine
run_shell_cmd("python -c 'from easybuild.easyblocks.r import EB_R'")
run_shell_cmd("python -c 'from easybuild.easyblocks.r import EB_R'", hidden=True)

# importing a non-existing module fails
err_msg = "No module named .*"
Expand Down Expand Up @@ -163,7 +166,7 @@ def write_module(path, txt):
self.assertTrue(os.path.samefile(repo_path, parent_path), msg)

# importing EB_R class from easybuild.easyblocks.r still works fine
run_shell_cmd("python -c 'from easybuild.easyblocks.r import EB_R'")
run_shell_cmd("python -c 'from easybuild.easyblocks.r import EB_R'", hidden=True)

# custom easyblocks override existing easyblocks (with custom easyblocks repo first in $PYTHONPATH)
for software in ['GCC', 'R']:
Expand All @@ -175,7 +178,7 @@ def write_module(path, txt):
self.assertTrue(os.path.samefile(custom_easyblocks_repo_path, parent_path), msg)

# importing EB_R class from easybuild.easyblocks.r still works fine
run_shell_cmd("python -c 'from easybuild.easyblocks.r import EB_R'")
run_shell_cmd("python -c 'from easybuild.easyblocks.r import EB_R'", hidden=True)


def suite():
Expand Down

0 comments on commit 94f5f41

Please sign in to comment.