B
<Fd @ s d Z ddlmZmZmZ ddlZddlmZm Z m
Z
mZ ddlZddl
mZmZ ddlZddlmZ ddlmZ ddlmZ dd lmZ e ee
ejd
dZdd
dZeedd ZdS )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.pyTc C s t | tr| gnt| } tjdkr0dd | D } t| ttd}| \}}| dkr^| |r|j
dkrtddd d
ddd
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
ntc S s"