Skip to content

Commit 2551315

Browse files
committed
Add pytest for error handling in test_variable.py
1 parent 869eb0e commit 2551315

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

brainpy/_src/math/object_transform/tests/test_variable.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import unittest
22

3+
import pytest
4+
35
import brainpy.math as bm
46

57

@@ -27,9 +29,10 @@ def fff(self):
2729
self.b *= self.a
2830
return self.b.value
2931

30-
print()
31-
f_jit = bm.jit(A().f)
32-
f_jit()
32+
with pytest.raises(NotImplementedError):
33+
print()
34+
f_jit = bm.jit(A().f)
35+
f_jit()
3336

34-
print()
35-
a = A()
37+
print()
38+
a = A()

0 commit comments

Comments
 (0)