From 6e3fbeb62ec6ca70718f0d527b0c12161caf7ac9 Mon Sep 17 00:00:00 2001 From: Lenny Truong Date: Mon, 20 Nov 2023 12:48:31 -0800 Subject: [PATCH] Fix __or__ logic --- fault/property.py | 7 ++++++- tests/test_property.py | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/fault/property.py b/fault/property.py index d2f4264c..94a5a162 100644 --- a/fault/property.py +++ b/fault/property.py @@ -318,7 +318,7 @@ def __call__(self, *args): stable = Function("$stable") -class PropertyUnaryOp: +class PropertyUnaryOp(Expression): pass @@ -328,6 +328,11 @@ class Not(PropertyUnaryOp): def __init__(self, arg): self.arg = arg + def __or__(self, other): + if isinstance(other, Property): + return other.__ror__(self) + return super().__or__(self) + def not_(arg): return Not(arg) diff --git a/tests/test_property.py b/tests/test_property.py index e2c30c95..ad8b6f86 100644 --- a/tests/test_property.py +++ b/tests/test_property.py @@ -9,8 +9,8 @@ def requires_ncsim(test_fn): def wrapper(test_fn, *args, **kwargs): - if not shutil.which("ncsim"): - return pytest.skip("need ncsim for SVA test") + # if not shutil.which("ncsim"): + # return pytest.skip("need ncsim for SVA test") return test_fn(*args, **kwargs) return decorator.decorator(wrapper, test_fn)