Skip to content

Commit

Permalink
dev(hansbug): add test_type_init_error
Browse files Browse the repository at this point in the history
  • Loading branch information
HansBug committed Dec 31, 2022
1 parent 7646c2c commit 3f7cb95
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/tree/tree/test_constraint.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 3f7cb95

Please sign in to comment.