Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion easybuild/tools/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@

from easybuild.base import fancylogger
from easybuild.tools.build_log import EasyBuildError, print_msg
from easybuild.tools.config import build_option


_log = fancylogger.getLogger('hooks', fname=False)
Expand Down Expand Up @@ -191,7 +192,8 @@ def run_hook(label, hooks, pre_step_hook=False, post_step_hook=False, args=None,

if msg is None:
msg = "Running %s hook..." % label
print_msg(msg)
if build_option('debug'):
print_msg(msg)

_log.info("Running '%s' hook function (arguments: %s)...", hook.__name__, args)
res = hook(*args)
Expand Down
4 changes: 3 additions & 1 deletion test/framework/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"""
import os
import sys
from test.framework.utilities import EnhancedTestCase, TestLoaderFiltered
from test.framework.utilities import EnhancedTestCase, TestLoaderFiltered, init_config
from unittest import TextTestRunner

import easybuild.tools.hooks
Expand Down Expand Up @@ -124,6 +124,8 @@ def test_run_hook(self):

hooks = load_hooks(self.test_hooks_pymod)

init_config(build_options={'debug': True})

self.mock_stdout(True)
self.mock_stderr(True)
run_hook('start', hooks)
Expand Down