-
Notifications
You must be signed in to change notification settings - Fork 117
Closed
Description
This is quite a useful function that converts any expression or variable to a deferrable. A usage scenario is the following:
import reframe.utility.sanity as sn
from reframe.core.deferrable import make_deferrable
class SomeFlexibleTest(...):
def __init__():
...
self.sanity_patterns = sn.assert_eq(sn.count(...), make_deferrable(self.num_tasks))num_tasks in such a case will be set at the run phase, so you need to defer its evaluation when writing the sanity patterns. Currently, you have to either import this function separately as above, or write your sanity function, e.g.,:
import reframe.utility.sanity as sn
class SomeFlexibleTest(...):
def __init__():
...
self.sanity_patterns = sn.assert_eq(sn.count(...), self.num_tasks_assigned)
@property
@sn.sanity_function
def num_tasks_assigned(self):
return self.num_tasks