diff --git a/src/stpipe/hooks.py b/src/stpipe/hooks.py index 7415ab05..6d61df74 100644 --- a/src/stpipe/hooks.py +++ b/src/stpipe/hooks.py @@ -3,8 +3,7 @@ """ import inspect -from . import function_wrapper -from . import utilities +from . import function_wrapper, utilities from .step import Step @@ -87,11 +86,13 @@ def get_hook_objects(step, hooktype, hooks): hooktype : str, "pre" or "post" strings, to indicate whether it is a pre- or post-hook hooks : str or class - path to executible script, or Step class to run as hook + path to executable script, or Step class to run as hook Returns ------- list of callables that can be run as a hook """ - return [hook_from_string_or_class(step, hooktype, i, hook) - for i, hook in enumerate(hooks)] + return [ + hook_from_string_or_class(step, hooktype, i, hook) + for i, hook in enumerate(hooks) + ] diff --git a/src/stpipe/subproc.py b/src/stpipe/subproc.py index 91df891a..b9c0ad04 100644 --- a/src/stpipe/subproc.py +++ b/src/stpipe/subproc.py @@ -26,7 +26,6 @@ class SystemCall(Step): """ # noqa: E501 def process(self, *args): - newargs = [] for i, arg in enumerate(args): if isinstance(arg, AbstractDataModel): diff --git a/tests/test_hooks.py b/tests/test_hooks.py index 5348c683..f1671efc 100644 --- a/tests/test_hooks.py +++ b/tests/test_hooks.py @@ -1,7 +1,5 @@ import pytest - -from jwst.stpipe import Step, Pipeline - +from jwst.stpipe import Pipeline, Step pytest.importorskip("jwst") @@ -38,7 +36,6 @@ def process(self, input_data): class HookStep(Step): - class_alias = "myhook" spec = """ diff --git a/tests/test_utilities.py b/tests/test_utilities.py index d0dbb992..33b10bf2 100644 --- a/tests/test_utilities.py +++ b/tests/test_utilities.py @@ -11,14 +11,15 @@ def test_func(): class HovercraftFullOfEels: pass -class Foo(Step): +class Foo(Step): def process(self, input_data): pass def test_import_class(): from stpipe import Step + step_class = import_class("stpipe.Step", subclassof=Step) assert step_class is Step