$93 GRAYBYTE WORDPRESS FILE MANAGER $27

SERVER : vnpttt-amd7f72-h1.vietnix.vn #1 SMP Fri May 24 12:42:50 UTC 2024
SERVER IP : 103.200.23.149 | ADMIN IP 216.73.216.22
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/opt/cloudlinux/venv/lib/python3.11/site-packages/numpy/array_api/tests/

HOME
Current File : /opt/cloudlinux/venv/lib/python3.11/site-packages/numpy/array_api/tests//test_validation.py
from typing import Callable

import pytest

from numpy import array_api as xp


def p(func: Callable, *args, **kwargs):
    f_sig = ", ".join(
        [str(a) for a in args] + [f"{k}={v}" for k, v in kwargs.items()]
    )
    id_ = f"{func.__name__}({f_sig})"
    return pytest.param(func, args, kwargs, id=id_)


@pytest.mark.parametrize(
    "func, args, kwargs",
    [
        p(xp.can_cast, 42, xp.int8),
        p(xp.can_cast, xp.int8, 42),
        p(xp.result_type, 42),
    ],
)
def test_raises_on_invalid_types(func, args, kwargs):
    """Function raises TypeError when passed invalidly-typed inputs"""
    with pytest.raises(TypeError):
        func(*args, **kwargs)

Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
14 Aug 2025 9.24 PM
root / root
0755
__pycache__
--
14 Aug 2025 9.24 PM
root / root
0755
__init__.py
0.275 KB
17 Apr 2025 8.10 PM
root / root
0644
test_array_object.py
16.636 KB
17 Apr 2025 8.10 PM
root / root
0644
test_creation_functions.py
4.905 KB
17 Apr 2025 8.10 PM
root / root
0644
test_data_type_functions.py
0.994 KB
17 Apr 2025 8.10 PM
root / root
0644
test_elementwise_functions.py
3.711 KB
17 Apr 2025 8.10 PM
root / root
0644
test_indexing_functions.py
0.612 KB
17 Apr 2025 8.10 PM
root / root
0644
test_manipulation_functions.py
1.062 KB
17 Apr 2025 8.10 PM
root / root
0644
test_set_functions.py
0.533 KB
17 Apr 2025 8.10 PM
root / root
0644
test_sorting_functions.py
0.588 KB
17 Apr 2025 8.10 PM
root / root
0644
test_validation.py
0.66 KB
17 Apr 2025 8.10 PM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF