Intelegentny_Pszczelarz/.venv/Lib/site-packages/numpy/array_api/tests/test_data_type_functions.py
2023-06-19 00:49:18 +02:00

20 lines
422 B
Python

import pytest
from numpy import array_api as xp
@pytest.mark.parametrize(
"from_, to, expected",
[
(xp.int8, xp.int16, True),
(xp.int16, xp.int8, False),
(xp.bool, xp.int8, False),
(xp.asarray(0, dtype=xp.uint8), xp.int8, False),
],
)
def test_can_cast(from_, to, expected):
"""
can_cast() returns correct result
"""
assert xp.can_cast(from_, to) == expected