← Back
Editing: nosetester.cpython-311.pyc
� ���c�K � �p � d Z ddlZddlZddlZddlZddlmZmZ g d�Z d� Z dd�Z G d� d � � Zd � Z dS )ze Nose test running. This module implements ``test()`` and ``bench()`` functions for NumPy modules. � N� )�import_nose�suppress_warnings)�get_package_name�run_module_suite� NoseTester� _numpy_testerr r r c �x � | dd� }g }d| v sd| v rDt j � | � � \ } }|dv rn|� |� � d| v �@d| v �D|sd|v rdS dS |� � � |d � d� � r|� 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_name�p2s �C/usr/lib/python3/dist-packages/numpy/testing/_private/nosetester.pyr r s� � � ����{�H��H� �X� %� %��H�)D�)D��w�}�}�X�.�.���"� �3�3�3��������� �X� %� %��H�)D�)D� � ��h����7��7� ������ ��{���F�#�#� ����Q�����8�8�H���� c � � | �8t j d� � }|j � dd� � } | �t �|�t j | gz }n|| gz }t � � }ddlm} |� | |� � g�� � 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��argv� addplugins) �sys� _getframe�f_locals�get�AssertionErrorr"