Skip to content

Commit

Permalink
Merge pull request #22775 from def-/pr-exclude-mechanism
Browse files Browse the repository at this point in the history
platform-checks: Fix @disabled
  • Loading branch information
def- authored Oct 30, 2023
2 parents 3849550 + 9972dc5 commit 20cf99d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions misc/python/materialize/checks/checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

0 comments on commit 20cf99d

Please sign in to comment.