OwlCyberSecurity - MANAGER
Edit File: nosetester.cpython-38.pyc
U �i]#P � @ s� d Z ddlmZmZmZ ddlZddlZddlZddlm Z ddl Zddlm Z mZ ddd d dddgZd d� Zddd�ZG dd � d e�Zdd � ZdS )ze Nose test running. This module implements ``test()`` and ``bench()`` functions for NumPy modules. � )�division�absolute_import�print_functionN)� basestring� )�import_nose�suppress_warnings�get_package_name�run_module_suite� NoseTester� _numpy_testerr r c C s� | dd� }g }d| ks d| krFt j�| �\} }|dkr:qF|�|� q|sZd|krVdS dS |�� |d �d�rz|�d� d �|�S ) a& Given a path where a package is installed, determine its name. Parameters ---------- filepath : str Path to a file. If the determination fails, "numpy" is returned. Examples -------- >>> np.testing.nosetester.get_package_name('nonsense') 'numpy' N� site-packages� dist-packages)r r �scipy�numpyr z.egg�.)�os�path�split�append�reverse�endswith�pop�join)�filepath�fullpath�pkg_nameZp2� r �C/usr/lib/python3/dist-packages/numpy/testing/_private/nosetester.pyr s c C st | dkr,t �d�}|j�dd�} | dkr,t�|dkrBt j| g }n || g }t� }ddlm} |j ||� gd� dS )a� Run a test module. Equivalent to calling ``$ nosetests <argv> <file_to_run>`` from the command line Parameters ---------- file_to_run : str, optional Path to test module, or None. By default, run the module from which this function is called. argv : list of strings Arguments to be passed to the nose test runner. ``argv[0]`` is ignored. All command line arguments accepted by ``nosetests`` will work. If it is the default value None, sys.argv is used. .. versionadded:: 1.9.0 Examples -------- Adding the following:: if __name__ == "__main__" : run_module_suite(argv=sys.argv) at the end of a test module will run the tests when that module is called in the python interpreter. Alternatively, calling:: >>> run_module_suite(file_to_run="numpy/tests/test_matlib.py") # doctest: +SKIP from an interpreter will run all the test routine in 'test_matlib.py'. Nr �__file__)�KnownFailurePlugin��argvZ addplugins) �sys� _getframe�f_locals�get�AssertionErrorr"