• File: test_scripts.pyc
  • Full Path: /home3/farmfre2/public_html/ALFA_DATA/alfasymlink/root/opt/alt/python27/lib64/python2.7/site-packages/numpy/tests/test_scripts.pyc
  • Date Modified: 12/19/2017 2:16 PM
  • File size: 3.36 KB
  • MIME-type: text/x-bytecode.python
  • Charset: 8 bit

9Zc@`s
dZddlmZmZmZddlZddlmZm	Z	m
Z
mZddlZddl
mZmZddlZddlmZmZddlmZddlmZdd	lmZe	ee
ejd
dZedZeed
ZdS(s\ Test scripts

Test that we can run executable scripts that have been installed with numpy.
i(tdivisiontprint_functiontabsolute_importN(tjointisfiletdirnametbasename(tPopentPIPE(t
basestringtasbytes(tassert_equal(tskipif(tassert_s..ssetup.pyc
C`st|tr|gn	t|}tjdkrjg|D]'}d|kr[dj|n|^q:}nt|dtdt}|j\}}|j	d
kr|jn|r|jdkrt
djddd	d
ddd	dgj|||n|j||fS(sp 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
    tntt s"{0}"tstdouttstderris
sCommand "{0}" failed withs------s{1}ts{2}N(t
isinstanceR	tlisttostnametformatRRtcommunicatetpolltNonet	terminatet
returncodetRuntimeErrorR(tcmdt
check_codetctprocRR((sK/opt/alt/python27/lib64/python2.7/site-packages/numpy/tests/test_scripts.pytrun_commands$7
	'cC`sPtjdkrttj}|jdr:d|}n
d|}ttj|dg\}}}|jtdk}t|dntj	}t
|d}t
|d	}d
d
|d
|d|f}	t}xW|	D]O}y?t|dg\}}}t|jtdt
}PWqqXqWd|	}
t||
dS(
Ntwin32tScriptss
%s\f2py.pys%s\Scripts\f2py.pys-vt2sWarning: f2py not found in pathiitf2pyt.s/Warning: neither %s nor %s nor %s found in path(tsystplatformRt
executabletendswithR"tstripR
R
tversion_infotstrtFalseRtTrue(texe_dirtf2py_cmdtcodeRRtsuccesstversiontmajortminort	f2py_cmdstmsg((sK/opt/alt/python27/lib64/python2.7/site-packages/numpy/tests/test_scripts.pyt	test_f2py=s.

!	

( t__doc__t
__future__RRRRtos.pathRtpathjoinRRRR(t
subprocessRRtnumpytnptnumpy.compat.py3kR	R
t
nose.toolsRtnumpy.testing.decoratorsRt
numpy.testingR
t__file__t
is_inplaceR0R"R:(((sK/opt/alt/python27/lib64/python2.7/site-packages/numpy/tests/test_scripts.pyt<module>s"!*