• File: test_scripts.cpython-37.opt-1.pyc
  • Full Path: /home3/farmfre2/public_html/ALFA_DATA/alfasymlink/root/opt/alt/python37/lib64/python3.7/site-packages/numpy/tests/__pycache__/test_scripts.cpython-37.opt-1.pyc
  • Date Modified: 04/24/2023 7:10 PM
  • File size: 2.78 KB
  • MIME-type: text/x-bytecode.python
  • Charset: 8 bit
B

<Fd@sdZddlmZmZmZddlZddlmZm	Z	m
Z
mZddlZddl
mZmZddlZddlmZddlmZddlmZdd	lmZe	ee
ejd
dZdd
dZeeddZdS)z\ Test scripts

Test that we can run executable scripts that have been installed with numpy.
)divisionprint_functionabsolute_importN)joinisfiledirnamebasename)PopenPIPE)
basestring)assert_equal)skipif)assert_z..zsetup.pyTcCst|tr|gnt|}tjdkr0dd|D}t|ttd}|\}}|dkr^|	|r|j
dkrtddd	d
ddd
d
dg
||||j
||fS)ap Run command sequence `cmd` returning exit code, stdout, stderr

    Parameters
    ----------
    cmd : str or sequence
        string with command name or sequence of strings defining command
    check_code : {True, False}, optional
        If True, raise error for non-zero return code

    Returns
    -------
    returncode : int
        return code from execution of `cmd`
    stdout : bytes (python 3) or str (python 2)
        stdout from `cmd`
    stderr : bytes (python 3) or str (python 2)
        stderr from `cmd`

    Raises
    ------
    RuntimeError
        If `check_code` is True, and return code !=0
    ntcSs"g|]}d|krd|n|qS) z"{0}")format).0crK/opt/alt/python37/lib64/python3.7/site-packages/numpy/tests/test_scripts.py
<listcomp>1szrun_command.<locals>.<listcomp>)stdoutstderrNr
zCommand "{0}" failed withrz------z{1}rz{2})
isinstancerlistosnamer	r
ZcommunicateZpollZ	terminate
returncodeRuntimeErrorrr)cmdZ
check_codeprocrrrrrrun_commands
r#cCstjdkr^ttj}|dr(d|}nd|}ttj|dg\}}}|dk}t|dntj}t	|j
}t	|j}dd|d|d	|f}	d
}xD|	D]<}y*t|dg\}}}t|dd}PWqYqXqWd|	}
t||
dS)
NZwin32ZScriptsz
%s\f2py.pyz%s\Scripts\f2py.pyz-v2zWarning: f2py not found in pathZf2py.FTz/Warning: neither %s nor %s nor %s found in path)
sysplatformr
executableendswithr#striprversion_infostrmajorminorr)exe_dirZf2py_cmdcoderrsuccessversionr-r.Z	f2py_cmdsmsgrrr	test_f2py>s.







r4)T)__doc__Z
__future__rrrrZos.pathrZpathjoinrrrr&
subprocessr	r
ZnumpyZnpZnumpy.compat.py3krZ
nose.toolsrZnumpy.testing.decoratorsr
Z
numpy.testingr__file__Z
is_inplacer#r4rrrr<module>s
*