Skip to content

Commit f5ed430

Browse files
committed
[tests] add a test also for a bad returned type
1 parent 81e742a commit f5ed430

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/types/test_table_eval.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
from __future__ import annotations
22

3+
import hist
34
import numpy as np
5+
import pytest
46

57
import lgdo
68

@@ -31,6 +33,7 @@ def test_eval_dependency():
3133
),
3234
}
3335
)
36+
3437
r = obj.eval("sum(a)")
3538
assert isinstance(r, lgdo.Scalar)
3639

@@ -81,3 +84,7 @@ def test_eval_dependency():
8184
# test with modules argument, the simplest is using directly lgdo
8285
res = obj.eval("lgdo.Array([1,2,3])", {}, modules={"lgdo": lgdo})
8386
assert res == lgdo.Array([1, 2, 3])
87+
88+
# check bad type
89+
with pytest.raises(RuntimeError):
90+
obj.eval("hist.Hist()", modules={"hist": hist})

0 commit comments

Comments
 (0)