-
Notifications
You must be signed in to change notification settings - Fork 117
Description
Currently, hooks in the same stage follow the reverse MRO order, i.e., hooks from the parent classes execute first. This is problematic in cases that the base class hooks provide final functionality needed by the subclasses and the subclasses simply need to set some test variables; this is a typical scenario in library tests. Due to this limitation, tests inheriting from a a base class have to be aware of where the base class hooks are placed and define their hooks accordingly. This harms portability. I would like to be able to define a base class test as such:
class base_func(...):
some_var = variable(str)
@run_before('run', when='last')
def prepare_run(self):
self.executable_opts = ['-f', self.some_var]
@rfm.simple_test
class my_test(base_func):
@run_before('run')
def i_cannot_set_this_before(self):
self.some_var = 'foo'This example currently fails as some_var is undefined when the prepare_run hook is executed, but I would like to be able specify that this hooks should be the last of all to run in that phase.
Metadata
Metadata
Assignees
Type
Projects
Status