Skip to content

Commit b457f9d

Browse files
committed
Update third party tests
1 parent 65743f0 commit b457f9d

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

dpnp/tests/third_party/cupy/core_tests/test_ndarray_copy_and_view.py

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ def get_strides(xp, a):
2525
return a.strides
2626

2727

28-
@pytest.mark.skip("'dpnp_array' object has no attribute 'view' yet")
2928
class TestView:
3029

3130
@testing.numpy_cupy_array_equal()
@@ -98,9 +97,9 @@ def test_view_relaxed_contiguous(self, xp, dtype):
9897
)
9998
@testing.numpy_cupy_equal()
10099
def test_view_flags_smaller(self, xp, order, shape):
101-
a = xp.zeros(shape, numpy.int32, order)
100+
a = xp.zeros(shape, dtype=numpy.int32, order=order)
102101
b = a.view(numpy.int16)
103-
return b.flags.c_contiguous, b.flags.f_contiguous, b.flags.owndata
102+
return b.flags.c_contiguous, b.flags.f_contiguous # , b.flags.owndata
104103

105104
@pytest.mark.parametrize(
106105
("order", "shape"),
@@ -112,7 +111,7 @@ def test_view_flags_smaller(self, xp, order, shape):
112111
@testing.with_requires("numpy>=1.23")
113112
def test_view_flags_smaller_invalid(self, order, shape):
114113
for xp in (numpy, cupy):
115-
a = xp.zeros(shape, numpy.int32, order)
114+
a = xp.zeros(shape, dtype=numpy.int32, order=order)
116115
with pytest.raises(ValueError):
117116
a.view(numpy.int16)
118117

@@ -121,17 +120,17 @@ def test_view_flags_smaller_invalid(self, order, shape):
121120
[
122121
("C", (6,)),
123122
("C", (3, 10)),
124-
("C", (0,)),
123+
# ("C", (0,)), # dpctl-2119
125124
("C", (1, 6)),
126125
("C", (3, 2)),
127126
],
128127
ids=str,
129128
)
130129
@testing.numpy_cupy_equal()
131130
def test_view_flags_larger(self, xp, order, shape):
132-
a = xp.zeros(shape, numpy.int16, order)
131+
a = xp.zeros(shape, dtype=numpy.int16, order=order)
133132
b = a.view(numpy.int32)
134-
return b.flags.c_contiguous, b.flags.f_contiguous, b.flags.owndata
133+
return b.flags.c_contiguous, b.flags.f_contiguous # , b.flags.owndata
135134

136135
@pytest.mark.parametrize(
137136
("order", "shape"),
@@ -144,7 +143,7 @@ def test_view_flags_larger(self, xp, order, shape):
144143
@testing.with_requires("numpy>=1.23")
145144
def test_view_flags_larger_invalid(self, order, shape):
146145
for xp in (numpy, cupy):
147-
a = xp.zeros(shape, numpy.int16, order)
146+
a = xp.zeros(shape, dtype=numpy.int16, order=order)
148147
with pytest.raises(ValueError):
149148
a.view(numpy.int32)
150149

@@ -161,7 +160,7 @@ def test_view_smaller_dtype_multiple(self, xp):
161160
@testing.numpy_cupy_array_equal()
162161
def test_view_smaller_dtype_multiple2(self, xp):
163162
# x is non-contiguous, and stride[-1] != 0
164-
x = xp.ones((3, 4), xp.int32)[:, :1:2]
163+
x = xp.ones((3, 4), dtype=xp.int32)[:, :1:2]
165164
return x.view(xp.int16)
166165

167166
@testing.with_requires("numpy>=1.23")
@@ -184,7 +183,7 @@ def test_view_non_c_contiguous(self, xp):
184183

185184
@testing.numpy_cupy_array_equal()
186185
def test_view_larger_dtype_zero_sized(self, xp):
187-
x = xp.ones((3, 20), xp.int16)[:0, ::2]
186+
x = xp.ones((3, 20), dtype=xp.int16)[:0, ::2]
188187
return x.view(xp.int32)
189188

190189

@@ -387,7 +386,7 @@ def test_astype_strides_broadcast(self, xp, src_dtype, dst_dtype):
387386
dst = astype_without_warning(src, dst_dtype, order="K")
388387
return get_strides(xp, dst)
389388

390-
@pytest.mark.skip("'dpnp_array' object has no attribute 'view' yet")
389+
@pytest.mark.skip("dpctl-2121")
391390
@testing.numpy_cupy_array_equal()
392391
def test_astype_boolean_view(self, xp):
393392
# See #4354
@@ -454,7 +453,7 @@ def __array_finalize__(self, obj):
454453
self.info = getattr(obj, "info", None)
455454

456455

457-
@pytest.mark.skip("'dpnp_array' object has no attribute 'view' yet")
456+
@pytest.mark.skip("subclass array is not supported")
458457
class TestSubclassArrayView:
459458

460459
def test_view_casting(self):

0 commit comments

Comments
 (0)