From 3f7cb9514615e7d72a8ec8288074713ce44c8949 Mon Sep 17 00:00:00 2001 From: HansBug Date: Sat, 31 Dec 2022 14:54:59 +0800 Subject: [PATCH] dev(hansbug): add test_type_init_error --- test/tree/tree/test_constraint.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/tree/tree/test_constraint.py b/test/tree/tree/test_constraint.py index e5422c70d6..cdf932e442 100644 --- a/test/tree/tree/test_constraint.py +++ b/test/tree/tree/test_constraint.py @@ -95,6 +95,10 @@ def test_type_with_meta(self): assert not (c1 > torch.Tensor) assert not (c1 < torch.Tensor) + def test_type_init_error(self): + with pytest.raises(AssertionError): + _ = TypeConstraint(123) + def test_type(self): c1 = to_constraint(int) assert isinstance(c1, TypeConstraint)