X7ROOT File Manager
Current Path:
/opt/cloudlinux/venv/lib/python3.11/site-packages/numpy/tests
opt
/
cloudlinux
/
venv
/
lib
/
python3.11
/
site-packages
/
numpy
/
tests
/
ðŸ“
..
📄
__init__.py
(0 B)
ðŸ“
__pycache__
📄
test__all__.py
(221 B)
📄
test_ctypeslib.py
(12 KB)
📄
test_lazyloading.py
(1.13 KB)
📄
test_matlib.py
(1.81 KB)
📄
test_numpy_config.py
(1.21 KB)
📄
test_numpy_version.py
(1.54 KB)
📄
test_public_api.py
(16.48 KB)
📄
test_reloading.py
(2.3 KB)
📄
test_scripts.py
(1.61 KB)
📄
test_warnings.py
(2.23 KB)
Editing: 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" )
Upload File
Create Folder