403Webshell
Server IP : 217.160.0.135  /  Your IP : 216.73.217.85
Web Server : Apache
System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64
User : sws1074145052 ( 1074145052)
PHP Version : 8.3.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /usr/lib/python3/dist-packages/IPython/testing/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3/dist-packages/IPython/testing/__pycache__/decorators.cpython-311.pyc
�

�@�c�����dZddlZddlZddlZddlZddlZddlZddlmZddl	m	Z	ddl
mZmZd�Z
d"d�Zd"d	�Zd
�Zd�Zeejdkd
��Zeej�d��d��Zeejdkd��Zeejdkd��Zeej�d��d��Zejdvoej�dd��dkZdZeee��Zd�Zed��Zed��Z d�Z!	ej"d���Z#dZ$e#�%��n
#e&$rdZ$YnwxYwee$d ��Z'd!�Z(dS)#aDecorators for labeling test objects.

Decorators that merely return a modified version of the original function
object are straightforward.  Decorators that return a new function object need
to use nose.tools.make_decorator(original_function)(decorator) in returning the
decorator, in order to preserve metadata such as function name, setup and
teardown functions and so on - see nose.tools for more information.

This module provides a set of useful decorators meant to be ready to use in
your own tests.  See the bottom of the file for the ready-made ones, and if you
find yourself writing a new one that may be of generic use, add it here.

Included decorators:


Lightweight testing that remains unittest-compatible.

- An @as_unittest decorator can be used to tag any normal parameter-less
  function as a unittest TestCase.  Then, both nose and normal unittest will
  recognize it as such.  This will make it easier to migrate away from Nose if
  we ever need/want to while maintaining very lightweight tests.

NOTE: This file contains IPython-specific decorators. Using the machinery in
IPython.external.decorators, we import either numpy.testing.decorators if numpy is
available, OR use equivalent code in IPython.external._decorators, which
we've copied verbatim from numpy.

�N)�
import_module)�	decorator�)�	ipdoctest�ipdocstringc�T��G�fd�dtj��}�j|_|S)zDDecorator to make a simple function into a normal test via unittest.c���eZdZ�fd�ZdS)�as_unittest.<locals>.Testerc������dS�N�)�self�funcs ��</usr/lib/python3/dist-packages/IPython/testing/decorators.py�testz as_unittest.<locals>.Tester.test7s����D�F�F�F�F�F�N)�__name__�
__module__�__qualname__r)rs�r�Testerr
6s.�������	�	�	�	�	�	�	rr)�unittest�TestCaser)rrs` r�as_unittestr4sJ�����������"�����m�F�O��Mrc�x�|�d}ddl}t|t��sJ�|j�||���S)a�Make function raise SkipTest exception if skip_condition is true

    Parameters
    ----------

    skip_condition : bool or callable
      Flag to determine whether to skip test. If the condition is a
      callable, it is used at runtime to dynamically make the decision. This
      is useful for tests that may require costly imports, to delay the cost
      until the test suite is actually executed.
    msg : string
      Message to give on raising a SkipTest exception.

    Returns
    -------
    decorator : function
      Decorator, which, when applied to a function, causes SkipTest
      to be raised when the skip_condition was True, and the function
      to be called normally otherwise.
    Nz#Test skipped due to test condition.r��reason)�pytest�
isinstance�bool�mark�skipif)�skip_condition�msgrs   rr!r!AsH��*�{�3���M�M�M��n�d�+�+�+�+�+��;���n�S��9�9�9rc�n�|r$t|t��std���td|��S)aYDecorator factory - mark a test function for skipping from test suite.

    Parameters
    ----------
      msg : string
        Optional message to be added.

    Returns
    -------
       decorator : function
         Decorator, which, when applied to a function, causes SkipTest
         to be raised, with the optional message added.
      zSinvalid object passed to `@skip` decorator, did you meant `@skip()` with brackets ?T)r�str�
ValueErrorr!)r#s r�skipr'asD���<�:�c�3�'�'�<��;�<�<�	<��$����rc�$�t||��S)z0The reverse from skipif, see skipif for details.)r!)�	conditionr#s  r�onlyifr*us���i�-��%�%�%rc�P�	t|��}d}n#t$rd}YnwxYw|S)z�Can module be imported?  Returns true if module does NOT import.

    This is used to make a decorator to skip tests that require module to be
    available, but delay the 'import numpy' to test execution time.
    FT)r�ImportError)�module�mod�
mod_not_avails   r�module_not_availabler0|sG����F�#�#���
�
�������
�
�
������s��#�#�win32z$This test does not run under Windows�linuxz"This test does not run under Linux�darwinz!This test does not run under OS Xz!This test only runs under WindowszThis test only runs under Linux)r3r1�DISPLAY�z.Skipped under *nix when X11/XOrg not availablec�B�tt|��d|z��S)NzThis test requires %s)r!r0)r.s r�<lambda>r7�s ��6�"6�s�";�";�=T�WZ�=Z�[�[�r�numpy�
matplotlibc��|Srr
)�fs rr7r7�s��a�rutmp€)�prefixTFzCThis test is only applicable where we can use unicode in filenames.c���tj�dd���
Jd���|D]=}d|�d�}tj|��s!ddl}|j�|���cS�>tS)zN
    Decorator to skip test when at least one of `commands` is not found.
    �IPTEST_WORKING_DIRNz#iptest deprecated since IPython 8.0z This test runs only if command 'z' is installedrr)	�os�environ�get�shutil�whichrr r'�	null_deco)�commands�cmdrrs    r�onlyif_cmds_existrG�s���
	�
���+�T�2�2�:�:�,�	;�:�:��3�3��G�C�G�G�G���|�C� � �	3��M�M�M��;�#�#�6�#�2�2�2�2�2�	3��rr))�__doc__r?rB�sys�tempfiler�warnings�	importlibrr�
ipunittestrrrr!r'r*r0�platform�
skip_win32�
startswith�
skip_linux�skip_osx�skip_if_not_win32�skip_if_not_linuxr@rA�_x11_skip_cond�
_x11_skip_msg�skip_if_no_x11�skip_without�skipif_not_numpy�skipif_not_matplotlibrD�NamedTemporaryFiler;�
unicode_paths�close�UnicodeEncodeError�onlyif_unicode_pathsrGr
rr�<module>r`s�����@
�	�	�	�
�
�
�
�
�
�
�
�������������#�#�#�#�#�#�������/�.�.�.�.�.�.�.����:�:�:�:�@����(&�&�&����&�V�C�L�G�+�:�<�<�
�
�V�C�L�+�+�G�4�4�8�:�:�
��6�#�,�(�*�+N�O�O���F�3�<�7�2�>�@�@���F�s�|�6�6�w�?�?�?�<�>�>���,�&9�9�6��*�.�.��B�/�/�2�5��@�
����
�6�6��
\�[���<��(�(��$��\�2�2��
�K�	��#��#�9�5�5�5�A��M��G�G�I�I�I�I��	�����M�M�M������v�m�/M�O�O��
�
�
�
�
s�E�E
�E


Youez - 2016 - github.com/yon3zu
LinuXploit