diff --git a/tests/test_permissive.py b/tests/test_permissive.py index f382fed..64224a5 100644 --- a/tests/test_permissive.py +++ b/tests/test_permissive.py @@ -22,7 +22,16 @@ def test_forcepermissive_and_unrestraint(config_type): cfg_ori.property.read_write() cfg = get_config(cfg_ori, config_type) with pytest.raises(ConfigError): - cfg_ori.forcepermissive.add('disabled') + cfg_ori.unrestraint.forcepermissive + + +def test_unrestraint_and_unrestraint(config_type): + od1 = make_description() + cfg_ori = Config(od1) + cfg_ori.property.read_write() + cfg_ori.property.read_write() + cfg = get_config(cfg_ori, config_type) + cfg_ori.unrestraint.unrestraint def test_permissive(config_type): diff --git a/tiramisu/api.py b/tiramisu/api.py index 6c3f7a2..c078e01 100644 --- a/tiramisu/api.py +++ b/tiramisu/api.py @@ -1931,6 +1931,8 @@ class TiramisuAPI(TiramisuHelp): def __getattr__(self, subfunc: str) -> Any: if subfunc in ["forcepermissive", "unrestraint", "nowarnings"]: + if subfunc == "unrestraint" and self._config_bag.is_unrestraint: + return self if self._orig_config_bags: msg = _( "do not use unrestraint, nowarnings or forcepermissive together"