Skip to content

Commit

Permalink
test case
Browse files Browse the repository at this point in the history
  • Loading branch information
Bchass committed Jun 3, 2024
1 parent 23bb543 commit 22f31e2
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tinynumpy/tests/test_tinynumpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,18 @@ def test_getitem():
a = np.array([[1, 2, 3, 4], [5, 6, 7, 8]])
b = tnp.array([[1, 2, 3, 4], [5, 6, 7, 8]])

def test_setitem_writeable():

a = tnp.array([1, 2, 3])
a[0] = 4
expected_result = tnp.array([4, 2, 3, 4, 5], dtype='int64')
assert all(a == expected_result)

with pytest.raises(ValueError):
a = tnp.array([1, 2, 3])
a.flags = {'WRITEABLE': False}
a[0] = 4


def test_transpose():
"""test the transpose function for tinynumpy"""
Expand Down

0 comments on commit 22f31e2

Please sign in to comment.