Skip to content

Commit 3ebe82d

Browse files
authored
Fix tests for dpctl change to return tuples (#2945)
dpctl returns tuples now rather than lists for devices, subdevices, etc. as these should be immutable to users
1 parent ffccc2e commit 3ebe82d

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ This release is compatible with NumPy 2.4.5.
2222
* Replaced `.pxi` includes in `dpnp.tensor` with modular `.pxd`/`.pyx` Cython imports [#2913](https://github.com/IntelPython/dpnp/pull/2913)
2323
* Reimplemented `dpnp.eye` and `dpnp.tensor.eye` with a branchless kernel [gh-2937](https://github.com/IntelPython/dpnp/pull/2937)
2424
* Cleaned up Python bindings for indexing functions, renaming `usm_ndarray_take` and `usm_ndarray_put` to `py_take` and `py_put` and refactoring validation [gh-2935](https://github.com/IntelPython/dpnp/pull/2935)
25+
* Fixed some tests which expected lists from `dpctl` functions which now return tuples (i.e., `dpctl.SyclDevice.create_sub_devices`) [gh-2945](https://github.com/IntelPython/dpnp/pull/2945)
2526

2627
### Deprecated
2728

dpnp/tests/tensor/test_usm_ndarray_dlpack.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ def test_dlpack_from_subdevice():
252252
sdevs = dev.create_sub_devices(partition=[1, 1])
253253
except dpctl.SyclSubDeviceCreationError:
254254
pytest.skip("Default device can not be partitioned")
255-
assert isinstance(sdevs, list) and len(sdevs) > 0
255+
assert isinstance(sdevs, tuple) and len(sdevs) > 0
256256
try:
257257
ctx = sdevs[0].sycl_platform.default_context
258258
except dpctl.SyclContextCreationError:
@@ -603,7 +603,7 @@ def test_dlpack_from_subdevice_to_kdlcpu():
603603
sdevs = dev.create_sub_devices(partition=[1, 1])
604604
except dpctl.SyclSubDeviceCreationError:
605605
pytest.skip("Default device can not be partitioned")
606-
assert isinstance(sdevs, list) and len(sdevs) > 0
606+
assert isinstance(sdevs, tuple) and len(sdevs) > 0
607607
try:
608608
ctx = sdevs[0].sycl_platform.default_context
609609
except dpctl.SyclContextCreationError:

0 commit comments

Comments
 (0)