File tree Expand file tree Collapse file tree 3 files changed +16
-1
lines changed Expand file tree Collapse file tree 3 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -148,6 +148,17 @@ def disable_hook(cls, hook_name):
148148 '''
149149 cls ._rfm_disabled_hooks .add (hook_name )
150150
151+ @classmethod
152+ def pipeline_hooks (cls ):
153+ ret = {}
154+ for c in cls .mro ():
155+ if hasattr (c , '_rfm_pipeline_hooks' ):
156+ for kind , hook in c ._rfm_pipeline_hooks .items ():
157+ ret .setdefault (kind , [])
158+ ret [kind ] += hook
159+
160+ return ret
161+
151162 #: The name of the test.
152163 #:
153164 #: :type: string that can contain any character except ``/``
Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ def fmt_deps():
7171 'Node allocation' : node_alloc_scheme ,
7272 'Pipeline hooks' : {
7373 k : fmt_list (fn .__name__ for fn in v )
74- for k , v in type ( check ). _rfm_pipeline_hooks .items ()
74+ for k , v in check . pipeline_hooks () .items ()
7575 },
7676 'Tags' : fmt_list (check .tags ),
7777 'Valid environments' : fmt_list (check .valid_prog_environs ),
Original file line number Diff line number Diff line change @@ -633,6 +633,10 @@ class MyTest(DerivedTest):
633633 _run (test , * local_exec_ctx )
634634 assert test .var == 2
635635 assert test .foo == 1
636+ assert test .pipeline_hooks () == {
637+ 'post_setup' : [DerivedTest .z , BaseTest .x ],
638+ 'pre_run' : [C .y ],
639+ }
636640
637641
638642def test_overriden_hooks (local_exec_ctx ):
You can’t perform that action at this time.
0 commit comments