Skip to content
Prev Previous commit
added return types for interop tests
  • Loading branch information
sakchal committed May 8, 2024
commit 51f16ce28e635c28fa7bfd910453e7f8c7b45a69
12 changes: 6 additions & 6 deletions tests/test_interop.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,23 @@
# flake8: noqa: E203


def test_numpy_to_af_array_type():
def test_numpy_to_af_array_type() -> None:
arr = np.array([1, 2, 3, 4])

af_array = numpy_to_af_array(arr)

assert isinstance(af_array, AFArray)


def test_af_to_numpy_array_type():
def test_af_to_numpy_array_type() -> None:
arr = wrapper.constant(2, (5, 5), int16)

np_arr = af_to_numpy_array(arr)

assert isinstance(np_arr, np.ndarray)


def test_pyopencl_to_af_array_type():
def test_pyopencl_to_af_array_type() -> None:
ctx = cl.create_some_context()
queue = cl.CommandQueue(ctx)

Expand All @@ -44,22 +44,22 @@ def test_pyopencl_to_af_array_type():
assert isinstance(af_array, AFArray)


def test_numpy_to_af_array_shape():
def test_numpy_to_af_array_shape() -> None:
np_arr = np.array([1, 2, 3, 4])

af_arr = numpy_to_af_array(np_arr)

assert get_dims(af_arr)[0 : get_numdims(af_arr)] == np_arr.shape[0 : get_numdims(af_arr)]


def test_af_to_numpy_array_shape():
def test_af_to_numpy_array_shape() -> None:
af_arr = wrapper.constant(2, (5, 5), int16)

np_arr = af_to_numpy_array(af_arr)
assert np_arr.shape[0 : get_numdims(af_arr)] == get_dims(af_arr)[0 : get_numdims(af_arr)]


def test_pyopencl_to_af_array_shape():
def test_pyopencl_to_af_array_shape() -> None:
ctx = cl.create_some_context()
queue = cl.CommandQueue(ctx)

Expand Down