B
    n\e                 @   s   d Z ddlmZmZmZ ddlZddlZddlZddlm	Z
mZmZ ddlZddlZddlmZ ddlmZmZ ee
eejddZd	d
 Zejjeddejjddejde dd Zdd ZdS )z\ Test scripts

Test that we can run executable scripts that have been installed with numpy.
    )divisionprint_functionabsolute_importN)joinisfiledirname)
basestring)assert_assert_equalz..zsetup.pyc              C   sz   t jdkrBtt j} | dr.tj| dgS tj| ddgS n4t j}t	|j
}t	|j}dd| d| d | gS d S )NZwin32ZScriptsZf2py.)sysplatformr   
executableendswithospathr   version_infostrmajorminor)exe_dirversionr   r    r   7lib/python3.7/site-packages/numpy/tests/test_scripts.pyfind_f2py_commands   s    




r   z Cannot test f2py command inplace)reasonzTest is unreliablef2py_cmdc             C   s    t | dg}t| d d S )Nz-v   2)
subprocesscheck_outputr
   strip)r   stdoutr   r   r   	test_f2py&   s    r"   c              C   s$   t tjddg} t|  d d S )Nz-mnumpy.f2pyz-vr   )r   r   r   r   r
   r    )r!   r   r   r   test_pep338/   s    r#   )__doc__Z
__future__r   r   r   r   r   Zpytestos.pathr   Zpathjoinr   r   r   ZnumpyZnpZnumpy.compat.py3kr   Znumpy.testingr	   r
   __file__Z
is_inplacer   ZmarkZskipifZxfailZparametrizer"   r#   r   r   r   r   <module>   s   