$54 GRAYBYTE WORDPRESS FILE MANAGER $98

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/tests/

HOME
Current File : /opt/cloudlinux/venv/lib/python3.11/site-packages/numpy/tests//test_numpy_config.py
"""
Check the numpy config is valid.
"""
import numpy as np
import pytest
from unittest.mock import Mock, patch

pytestmark = pytest.mark.skipif(
    not hasattr(np.__config__, "_built_with_meson"),
    reason="Requires Meson builds",
)


class TestNumPyConfigs:
    REQUIRED_CONFIG_KEYS = [
        "Compilers",
        "Machine Information",
        "Python Information",
    ]

    @patch("numpy.__config__._check_pyyaml")
    def test_pyyaml_not_found(self, mock_yaml_importer):
        mock_yaml_importer.side_effect = ModuleNotFoundError()
        with pytest.warns(UserWarning):
            np.show_config()

    def test_dict_mode(self):
        config = np.show_config(mode="dicts")

        assert isinstance(config, dict)
        assert all([key in config for key in self.REQUIRED_CONFIG_KEYS]), (
            "Required key missing,"
            " see index of `False` with `REQUIRED_CONFIG_KEYS`"
        )

    def test_invalid_mode(self):
        with pytest.raises(AttributeError):
            np.show_config(mode="foo")

    def test_warn_to_add_tests(self):
        assert len(np.__config__.DisplayModes) == 2, (
            "New mode detected,"
            " please add UT if applicable and increment this count"
        )

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 KB
17 Apr 2025 8.10 PM
root / root
0644
test__all__.py
0.216 KB
17 Apr 2025 8.10 PM
root / root
0644
test_ctypeslib.py
12.002 KB
17 Apr 2025 8.10 PM
root / root
0644
test_lazyloading.py
1.135 KB
17 Apr 2025 8.10 PM
root / root
0644
test_matlib.py
1.809 KB
17 Apr 2025 8.10 PM
root / root
0644
test_numpy_config.py
1.212 KB
17 Apr 2025 8.10 PM
root / root
0644
test_numpy_version.py
1.538 KB
17 Apr 2025 8.10 PM
root / root
0644
test_public_api.py
16.477 KB
17 Apr 2025 8.10 PM
root / root
0644
test_reloading.py
2.299 KB
17 Apr 2025 8.10 PM
root / root
0644
test_scripts.py
1.606 KB
17 Apr 2025 8.10 PM
root / root
0644
test_warnings.py
2.227 KB
17 Apr 2025 8.10 PM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF