Current File : //usr/local/apps/python3/lib/python3.11/test/__pycache__/test_doctest2.cpython-311.pyc
�

�Keo	����dZddlZddlZejjdkrejd���Gd�de��ZGd�dej��Z	dd	l
Ted
krej��dSdS)u�A module to test whether doctest recognizes some 2.2 features,
like static and class methods.

>>> print('yup')  # 1
yup

We include some (random) encoded (utf-8) text in the text surrounding
the example.  It should be ignored:

ЉЊЈЁЂ

�N�zCannot test docstrings with -O2c��eZdZdZd�Zd�ZGd�de��Zd�Zd�Z	e
ee	d�	��Zed
���Z
ed���ZdS)
�Cu�Class C.

    >>> print(C())  # 2
    42


    We include some (random) encoded (utf-8) text in the text surrounding
    the example.  It should be ignored:

        ЉЊЈЁЂ

    c��dS)z;C.__init__.

        >>> print(C()) # 3
        42
        N���selfs �</usr/local/apps/python3/lib/python3.11/test/test_doctest2.py�__init__z
C.__init__!�����c��dS)z/
        >>> print(C()) # 4
        42
        �42rrs r
�__str__z	C.__str__(s	��
�tr
c��eZdZdZd�ZdS)�C.DzJA nested D class.

        >>> print("In D!")   # 5
        In D!
        c��dS)z8
            >>> print(3) # 6
            3
            Nrrs r
�nestedz
C.D.nested6rr
N)�__name__�
__module__�__qualname__�__doc__rrr
r
�Dr/s-������	�	�	�	�	�	�	r
rc��|jS)zg
        >>> c = C()    # 7
        >>> c.x = 12   # 8
        >>> print(c.x)  # 9
        -12
        ��_xrs r
�getxzC.getx<s
����x�r
c��||_dS)zm
        >>> c = C()     # 10
        >>> c.x = 12    # 11
        >>> print(c.x)   # 12
        -12
        Nr)r	�values  r
�setxzC.setxEs������r
zi        >>> c = C()    # 13
        >>> c.x = 12   # 14
        >>> print(c.x)  # 15
        -12
        )�docc��dS)z�
        A static method.

        >>> print(C.statm())    # 16
        666
        >>> print(C().statm())  # 17
        666
        i�rrr
r
�statmzC.statmUs	���sr
c��|S)z�
        A class method.

        >>> print(C.clsm(22))    # 18
        22
        >>> print(C().clsm(23))  # 19
        23
        r)�cls�vals  r
�clsmzC.clsmas	���
r
N)rrrrrr�objectrrr �property�x�staticmethodr#�classmethodr'rr
r
rrs��������������������F����������	���t�"�	
�	
�	
�A��	�	��\�	��	�	��[�	�	�	r
rc��eZdZd�ZdS)�Testc���ddl}ddl}d}|�|jt��\}}|r|�d||fz��||kr|�d||fz��dSdS)Nr�z%d of %d doctests failedz expected %d tests to run, not %d)�doctest�sys�testmod�modulesr�fail)r	r1r2�EXPECTED�f�ts      r
�test_testmodzTest.test_testmodos����������������s�{�8�4�5�5���1��	;��I�I�0�A�q�6�9�:�:�:���=�=��I�I�8�H�a�=�H�I�I�I�I�I��=r
N)rrrr9rr
r
r.r.ns(������J�J�J�J�Jr
r.)�*�__main__)
rr2�unittest�flags�optimize�SkipTestr(r�TestCaser.r1r�mainrr
r
�<module>rBs������
�
�
������9�����
�(�
�=�
>�
>�>�X�X�X�X�X��X�X�X�vJ�J�J�J�J�8��J�J�J������z����H�M�O�O�O�O�O��r