$97 GRAYBYTE WORDPRESS FILE MANAGER $60

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 172.67.162.162 | ADMIN IP 216.73.216.174
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_scripts.py
""" Test scripts

Test that we can run executable scripts that have been installed with numpy.
"""
import sys
import os
import pytest
from os.path import join as pathjoin, isfile, dirname
import subprocess

import numpy as np
from numpy.testing import assert_equal, IS_WASM

is_inplace = isfile(pathjoin(dirname(np.__file__),  '..', 'setup.py'))


def find_f2py_commands():
    if sys.platform == 'win32':
        exe_dir = dirname(sys.executable)
        if exe_dir.endswith('Scripts'): # virtualenv
            return [os.path.join(exe_dir, 'f2py')]
        else:
            return [os.path.join(exe_dir, "Scripts", 'f2py')]
    else:
        # Three scripts are installed in Unix-like systems:
        # 'f2py', 'f2py{major}', and 'f2py{major.minor}'. For example,
        # if installed with python3.9 the scripts would be named
        # 'f2py', 'f2py3', and 'f2py3.9'.
        version = sys.version_info
        major = str(version.major)
        minor = str(version.minor)
        return ['f2py', 'f2py' + major, 'f2py' + major + '.' + minor]


@pytest.mark.skipif(is_inplace, reason="Cannot test f2py command inplace")
@pytest.mark.xfail(reason="Test is unreliable")
@pytest.mark.parametrize('f2py_cmd', find_f2py_commands())
def test_f2py(f2py_cmd):
    # test that we can run f2py script
    stdout = subprocess.check_output([f2py_cmd, '-v'])
    assert_equal(stdout.strip(), np.__version__.encode('ascii'))


@pytest.mark.skipif(IS_WASM, reason="Cannot start subprocess")
def test_pep338():
    stdout = subprocess.check_output([sys.executable, '-mnumpy.f2py', '-v'])
    assert_equal(stdout.strip(), np.__version__.encode('ascii'))


Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
11 Feb 2026 9.30 AM
root / root
0755
__pycache__
--
11 Feb 2026 9.30 AM
root / root
0755
__init__.py
0 KB
20 Jan 2026 1.01 PM
root / root
0644
test__all__.py
0.216 KB
20 Jan 2026 1.01 PM
root / root
0644
test_ctypeslib.py
12.002 KB
20 Jan 2026 1.01 PM
root / root
0644
test_lazyloading.py
1.135 KB
20 Jan 2026 1.01 PM
root / root
0644
test_matlib.py
1.809 KB
20 Jan 2026 1.01 PM
root / root
0644
test_numpy_config.py
1.212 KB
20 Jan 2026 1.01 PM
root / root
0644
test_numpy_version.py
1.538 KB
20 Jan 2026 1.01 PM
root / root
0644
test_public_api.py
16.477 KB
20 Jan 2026 1.01 PM
root / root
0644
test_reloading.py
2.299 KB
20 Jan 2026 1.01 PM
root / root
0644
test_scripts.py
1.606 KB
20 Jan 2026 1.01 PM
root / root
0644
test_warnings.py
2.227 KB
20 Jan 2026 1.01 PM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025 CONTACT ME
Static GIF