
    ;eo	                         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
T ed
k    r ej                     dS dS )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                       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d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                     dS )z;C.__init__.

        >>> print(C()) # 3
        42
        N selfs    )/usr/lib/python3.11/test/test_doctest2.py__init__z
C.__init__!             c                     dS )z/
        >>> print(C()) # 4
        42
        42r   r   s    r
   __str__z	C.__str__(   s	    
 tr   c                       e Zd ZdZd ZdS )C.DzJA nested D class.

        >>> print("In D!")   # 5
        In D!
        c                     dS )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                     || _         dS )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                      dS )z
        A static method.

        >>> print(C.statm())    # 16
        666
        >>> print(C().statm())  # 17
        666
        i  r   r   r   r
   statmzC.statmU   s	     sr   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      s                 F        	t " 	 	 	A 	 	 \	 	 	 [	 	 	r   r   c                       e Zd Zd ZdS )Testc                     dd l }dd l}d}|                    |j        t                             \  }}|r|                     d||fz             ||k    r|                     d||fz             d S d S )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51 	;II0Aq69:::==II8Ha=HIIIII =r   N)r   r   r   r9   r   r   r
   r.   r.   n   s(        J J J J Jr   r.   )*__main__)r   r2   unittestflagsoptimizeSkipTestr(   r   TestCaser.   r1   r   mainr   r   r
   <module>rB      s     


 9
(
=
>
>>X X X X X X X XvJ J J J J8 J J J    zHMOOOOO r   