diff --git a/misc/python/materialize/checks/checks.py b/misc/python/materialize/checks/checks.py index debcdcb79a1fb..326c9383e0974 100644 --- a/misc/python/materialize/checks/checks.py +++ b/misc/python/materialize/checks/checks.py @@ -18,10 +18,13 @@ class Check: + # Has to be set for the class already, not just in the constructor, so that + # we can change the value for the entire class in the decorator + enabled: bool = True + def __init__(self, base_version: MzVersion, rng: Random | None) -> None: self.base_version = base_version self.rng = rng - self.enabled = True def _can_run(self, e: Executor) -> bool: return True @@ -74,10 +77,10 @@ class ClassWrapper: def __init__(self, cls: type[Check]): assert issubclass(cls, Check) self.check_class = cls + self.check_class.enabled = False def __call__(self, *cls_ars: Any): check = self.check_class(*cls_ars) - check.enabled = False return check return ClassWrapper