Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes15kdownloads
_pytesttester.cpython-313.pyc121 linesDownload Raw Back to __pycache__
1�

2z�j���8�SrSSKrSSKrS/rSr"SS5rg)a�3Pytest test running.4 5This module implements the ``test()`` function for NumPy modules. The usual6boiler plate for doing that is to put the following in the module7``__init__.py`` file::8 9    from numpy._pytesttester import PytestTester10    test = PytestTester(__name__)11    del PytestTester12 13 14Warnings filtering and other runtime settings should be dealt with in the15``pytest.ini`` file in the numpy repo root. The behavior of the test depends on16whether or not that file is found as follows:17 18* ``pytest.ini`` is present (develop mode)19    All warnings except those explicitly filtered out are raised as error.20* ``pytest.ini`` is absent (release mode)21    DeprecationWarnings and PendingDeprecationWarnings are ignored, other22    warnings are passed through.23 24In practice, tests run from the numpy repo are run in development mode with25``spin``, through the standard ``spin test`` invocation or from an inplace26build with ``pytest numpy``.27 28This module is imported by every numpy subpackage, so lies at the top level to29simplify circular import issues. For the same reason, it contains no numpy30imports at module scope, instead importing numpy within function calls.31�N�PytestTesterc��SSKn[SUR35 URRR5n[SU=(d S5 g)NrzNumPy version zNumPy CPU features: znothing enabled)�numpy�print�__version__�lib�_utils_impl�	_opt_info)�np�infos  �YD:\code\apps\devtools\python\user_packages\Python313\site-packages\numpy/_pytesttester.py�_show_numpy_infor%sB���	�N�2�>�>�*�32+�,�
�6�6���'�'�)�D�	�33 �4�#<�+<�>�c�,�\rSrSrSrSrSSjrSrg)r�-as34Pytest test runner.35 36A test function is typically added to a package's __init__.py like so::37 38  from numpy._pytesttester import PytestTester39  test = PytestTester(__name__).test40  del PytestTester41 42Calling this test function finds and runs all tests associated with the43module and all its sub-modules.44 45Attributes46----------47module_name : str48    Full path to the package to test.49 50Parameters51----------52module_name : module name53    The name of the module to test.54 55Notes56-----57Unlike the previous ``nose``-based implementation, this class is not58publicly exposed as it performs some ``numpy``-specific warning59suppression.60 61c��XlXlg)N)�module_name�62__module__)�selfrs  r
�__init__�PytestTester.__init__Ks
��&��%�rNc�\�SSKnSSKn	[RURn63[64RRU65RS5nS/nUS/-
n[RS:a0UR5 URS5 SSKJ
n
 SSS5 U/SQ-
nUS	S66/-
nU(aUS/-
nU(aU[U5-
nUS:�aUS
SUS-67--/-
nU(a	USU-/-
nUS:XaSSKJn U(aUSS/-
nOUSS/-
nO
US:waUSU/-
nUS:�a	USU3/-
nUc
UR/nUS/[U5--
n[#5 U	R%U5nUS:H$!,(df   N�=f![&anUR(nSnAUS:H$SnAff=f)a�68Run tests for module using pytest.69 70Parameters71----------72label : {'fast', 'full'}, optional73    Identifies the tests to run. When set to 'fast', tests decorated74    with `pytest.mark.slow` are skipped, when 'full', the slow marker75    is ignored.76verbose : int, optional77    Verbosity value for test outputs, in the range 1-3. Default is 1.78extra_argv : list, optional79    List with any extra arguments to pass to pytests.80doctests : bool, optional81    .. note:: Not supported82coverage : bool, optional83    If True, report coverage of NumPy code. Default is False.84    Requires installation of (pip) pytest-cov.85durations : int, optional86    If < 0, do nothing, If 0, report time of all tests, if > 0,87    report the time of the slowest `timer` tests. Default is -1.88tests : test or list of tests89    Tests to be executed with pytest '--pyargs'90 91Returns92-------93result : bool94    Return True on success, false otherwise.95 96Notes97-----98Each NumPy module exposes `test` in its namespace to run all tests for99it. For example, to run all tests for numpy.lib:100 101>>> np.lib.test() #doctest: +SKIP102 103Examples104--------105>>> result = np.lib.test() #doctest: +SKIP106...1071023 passed, 2 skipped, 6 deselected, 1 xfailed in 10.39 seconds108>>> result109True110 111rNz-lz-q)���always)�cpuinfo)z!-W ignore:Not importing directoryz"-W ignore:numpy.dtype size changedz"-W ignore:numpy.ufunc size changedz-W ignore::UserWarning:cpuinfoz$-W ignore:the matrix subclass is notz(-W ignore:Importing from numpy.matlib isz--doctest-modules��-�vz--cov=�fast)�IS_PYPYz-mznot slow and not slow_pypyznot slow�fullz--durations=z--pyargs)�warnings�pytest�sys�modulesr�os�path�abspath�__path__�version_info�catch_warnings�simplefilter�numpy.distutilsr�list�
numpy.testingr!r�main�112SystemExit�code)r�label�verbose�113extra_argv�doctests�coverage�	durations�testsr#r$�module�module_path�pytest_argsrr!r3�excs                 r
�__call__�PytestTester.__call__Os���^	�����T�-�-�.���g�g�o�o�f�o�o�a�&8�9���f��	��v������g�%��(�(�*��%�%�h�/�4�+�	��	��	�2�6��	��114��/�0�0�K���4�115�+�+�K��Q�;��C�#��1��"5�5�6�6�K���H�{�2�3�3�K��F�?�-����&B�C�C����j�1�1��
�f�_��D�%�=�(�K���>��l�9�+�6�7�7�K��=��%�%�&�E��116�|�d�5�k�1�1��	��	��;�;�{�+�D��q�y��{+�*��t�	��8�8�D��q�y���	�s$�?E6� F�6117F�118F+�F&�&F+)rr)r rNFF�����N)�__name__r�__qualname__�__firstlineno__�__doc__rr?�__static_attributes__�rr
rr-s���:&�<@�EI�zr)rEr'r%�__all__rrrGrr
�<module>rIs+���<119�120��121��?�\�\r
codekingpro/portable-devtools · Team Ai