SILENT KILLERPanel

Current Path: > > opt > cloudlinux > venv > lib > python3.11 > site-packages > > numpy > > tests >


Operation   : Linux premium131.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
Software     : Apache
Server IP    : 162.0.232.56 | Your IP: 216.73.216.111
Domains      : 1034 Domain(s)
Permission   : [ 0755 ]

Files and Folders in: //opt/cloudlinux/venv/lib/python3.11/site-packages//numpy//tests/

NameTypeSizeLast ModifiedActions
__pycache__ Directory - -
__init__.py File 0 bytes April 17 2025 13:10:58.
test__all__.py File 221 bytes April 17 2025 13:10:58.
test_ctypeslib.py File 12290 bytes April 17 2025 13:10:58.
test_lazyloading.py File 1162 bytes April 17 2025 13:10:58.
test_matlib.py File 1852 bytes April 17 2025 13:10:58.
test_numpy_config.py File 1241 bytes April 17 2025 13:10:58.
test_numpy_version.py File 1575 bytes April 17 2025 13:10:58.
test_public_api.py File 16872 bytes April 17 2025 13:10:58.
test_reloading.py File 2354 bytes April 17 2025 13:10:58.
test_scripts.py File 1645 bytes April 17 2025 13:10:58.
test_warnings.py File 2280 bytes April 17 2025 13:10:58.

Reading File: //opt/cloudlinux/venv/lib/python3.11/site-packages//numpy//tests//test_lazyloading.py

import sys
import importlib
from importlib.util import LazyLoader, find_spec, module_from_spec
import pytest


# Warning raised by _reload_guard() in numpy/__init__.py
@pytest.mark.filterwarnings("ignore:The NumPy module was reloaded")
def test_lazy_load():
    # gh-22045. lazyload doesn't import submodule names into the namespace
    # muck with sys.modules to test the importing system
    old_numpy = sys.modules.pop("numpy")

    numpy_modules = {}
    for mod_name, mod in list(sys.modules.items()):
        if mod_name[:6] == "numpy.":
            numpy_modules[mod_name] = mod
            sys.modules.pop(mod_name)

    try:
        # create lazy load of numpy as np
        spec = find_spec("numpy")
        module = module_from_spec(spec)
        sys.modules["numpy"] = module
        loader = LazyLoader(spec.loader)
        loader.exec_module(module)
        np = module

        # test a subpackage import
        from numpy.lib import recfunctions

        # test triggering the import of the package
        np.ndarray

    finally:
        if old_numpy:
            sys.modules["numpy"] = old_numpy
            sys.modules.update(numpy_modules)

SILENT KILLER Tool