Skip to content

Commit de683b7

Browse files
committed
[*] update tests (fix pipeline)
1 parent 7a89c46 commit de683b7

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

python/tests/test_storage_view.py

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,26 @@ def test_storageview_cpu(dtype, name):
3737
with pytest.raises(AttributeError, match="CPU"):
3838
s.__cuda_array_interface__
3939

40-
assert str(s) == " 1 1 1 ... 1 1 1\n[cpu:0 %s storage viewed as 2x4]" % name
40+
expected_output = (
41+
"Data (2D Matrix):"
42+
"\n[[1, 1, 1, 1], "
43+
"\n[1, 1, 1, 1]]"
44+
"\n[device:{}:{}, dtype:{}, storage viewed as {}x{}]"
45+
).format(s.device, s.device_index, name, s.shape[0], s.shape[1])
46+
47+
assert str(s) == expected_output
4148

4249
x[0][2] = 3
4350
x[1][3] = 8
44-
assert str(s) == " 1 1 3 ... 1 1 8\n[cpu:0 %s storage viewed as 2x4]" % name
51+
52+
expected_output = (
53+
"Data (2D Matrix):"
54+
"\n[[1, 1, 3, 1], "
55+
"\n[1, 1, 1, 8]]"
56+
"\n[device:{}:{}, dtype:{}, storage viewed as {}x{}]"
57+
).format(s.device, s.device_index, name, s.shape[0], s.shape[1])
58+
59+
assert str(s) == expected_output
4560

4661
y = np.array(x)
4762
assert test_utils.array_equal(x, y)

0 commit comments

Comments
 (0)