
    dafo	                         d Z ddlZddlZej                  j                  dk\  r ej
                  d       G d de      Z G d dej                        Z	dd	l
 ed
k(  r ej                          yy)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   zCannot test docstrings with -O2c                   t    e Zd ZdZd Zd Z G d de      Zd Zd Z	 e
ee	d	      Zed
        Zed        Zy)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                      y)z;C.__init__.

        >>> print(C()) # 3
        42
        N selfs    :/root/Python-3.12.4/Lib/test/test_doctest/test_doctest2.py__init__z
C.__init__!           c                      y)z/
        >>> print(C()) # 4
        42
        42r   r   s    r
   __str__z	C.__str__(   s    
 r   c                       e Zd ZdZd Zy)C.DzJA nested D class.

        >>> print("In D!")   # 5
        In D!
        c                      y)z8
            >>> print(3) # 6
            3
            Nr   r   s    r
   nestedz
C.D.nested6   r   r   N)__name__
__module____qualname____doc__r   r   r   r
   Dr   /   s    		r   r   c                     | j                    S )zg
        >>> c = C()    # 7
        >>> c.x = 12   # 8
        >>> print(c.x)  # 9
        -12
        _xr   s    r
   getxzC.getx<   s     xr   c                     || _         y)zm
        >>> c = C()     # 10
        >>> c.x = 12    # 11
        >>> print(c.x)   # 12
        -12
        Nr   )r	   values     r
   setxzC.setxE   s     r   zi        >>> c = C()    # 13
        >>> c.x = 12   # 14
        >>> print(c.x)  # 15
        -12
        )docc                       y)z
        A static method.

        >>> print(C.statm())    # 16
        666
        >>> print(C().statm())  # 17
        666
        i  r   r   r   r
   statmzC.statmU   s     r   c                     |S )z
        A class method.

        >>> print(C.clsm(22))    # 18
        22
        >>> print(C().clsm(23))  # 19
        23
        r   )clsvals     r
   clsmzC.clsma   s	     
r   N)r   r   r   r   r   r   objectr   r   r    propertyxstaticmethodr#   classmethodr'   r   r   r
   r   r      sd    F  	t " 	A 	 	 	 	r   r   c                       e Zd Zd Zy)Testc                     dd l }dd l}d}|j                  |j                  t                 \  }}|r| j                  d||fz         ||k7  r| j                  d||fz         y y )Nr      z%d of %d doctests failedz expected %d tests to run, not %d)doctestsystestmodmodulesr   fail)r	   r1   r2   EXPECTEDfts         r
   test_testmodzTest.test_testmodo   s`    s{{8451II0Aq69:=II8Ha=HI r   N)r   r   r   r9   r   r   r
   r.   r.   n   s    Jr   r.   )*__main__)r   r2   unittestflagsoptimizeSkipTestr(   r   TestCaser.   r1   r   mainr   r   r
   <module>rB      sx     99
(

=
>>X XvJ8 J zHMMO r   