Skip to content

Commit beaf616

Browse files
committed
add test
1 parent fe687d0 commit beaf616

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

bindings/pyroot/pythonizations/test/numbadeclare.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -683,6 +683,17 @@ def square_std_arr(v):
683683
results = df.Take["RVec<int>"]("square_std_arr").GetValue()[0]
684684
self.assertTrue(np.array_equal(results, np.array([1, 4, 9])))
685685

686+
def test_missing_signature_raises(self):
687+
"""
688+
Ensure a RuntimeError is raised when return type cannot be inferred
689+
and no explicit signature is provided in the decorator.
690+
"""
691+
def f(x):
692+
return x.M()
693+
694+
with self.assertRaises(Exception):
695+
ROOT.RDataFrame(4).Define("v", "ROOT::Math::PtEtaPhiMVector(1, 2, 3, 4)").Define("m", f, ["v"])
696+
686697

687698
if __name__ == "__main__":
688699
unittest.main()

0 commit comments

Comments
 (0)