Skip to content

Commit 19fbcf8

Browse files
committed
Add test for get_scalar_constant
1 parent 8489d8b commit 19fbcf8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/tensor/test_basic.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
flatnonzero,
5252
flatten,
5353
full_like,
54+
get_scalar_constant,
5455
get_underlying_scalar_constant,
5556
get_vector_length,
5657
horizontal_stack,
@@ -3429,6 +3430,12 @@ def test_None_and_NoneConst(self, only_process_constants):
34293430
)
34303431

34313432

3433+
def test_get_scalar_constant():
3434+
with pytest.raises(NotScalarConstantError):
3435+
get_scalar_constant(np.zeros(5))
3436+
assert get_scalar_constant(np.array(4)) == 4
3437+
3438+
34323439
def test_complex_mod_failure():
34333440
# Make sure % fails on complex numbers.
34343441
x = vector(dtype="complex64")

0 commit comments

Comments
 (0)