o
    Ö­jÕ  ã                   @   s¨   d Z ddlZddlZddlmZmZ ddlmZ ejj	dkZ
dZdZdZd	Zeeed
œZdZdd„ Zdd„ Zdd„ Zejje
dd�dd„ ƒZejje
dd�dd„ ƒZdS )z@ Some tests for the documenting decorator and support functions é    N)Úassert_equalÚsuppress_warnings)Údocceré   zBDocstring
    %(strtest1)s
        %(strtest2)s
     %(strtest3)s
z Another test
   with some indentzAnother test, one linez(    Another test
       with some indent)Ústrtest1Ústrtest2Ústrtest3z|Docstring
    Another test
       with some indent
        Another test, one line
     Another test
       with some indent
c                  C   sh   t ƒ �'} | jtd� tt t¡tƒ tt t¡tƒ tt t¡tƒ W d   ƒ d S 1 s-w   Y  d S )N©Úcategory)	r   ÚfilterÚDeprecationWarningr   r   Úunindent_stringÚ
param_doc1Ú
param_doc2Ú
param_doc3)Úsup© r   úY/var/www/html/CropPilot/venv/lib/python3.10/site-packages/scipy/_lib/tests/test_doccer.pyÚtest_unindent+   s   "ür   c                  C   sv   t ƒ �} | jtd� t t¡}W d   ƒ n1 sw   Y  t|d td ƒ t|d td ƒ t|d td ƒ d S )Nr	   r   r   r   )r   r   r   r   Úunindent_dictÚdoc_dictr   )r   Úd2r   r   r   Útest_unindent_dict3   s   þr   c                  C   sr   t ƒ �,} | jtd� t t¡}t t|¡}t|t	ƒ d}t |t¡}t|dƒ W d   ƒ d S 1 s2w   Y  d S )Nr	   zSingle line doc %(strtest1)sz0Single line doc Another test
   with some indent)
r   r   r   r   r   r   Ú	docformatÚ	docstringr   Úfilled_docstring)r   ÚuddÚ	formattedÚ
single_docr   r   r   Útest_docformat<   s   

"÷r   zdocstrings stripped)Úreasonc                  C   s¢   t ƒ �D} | jtd� t td¡}|dd„ ƒ}dd„ }t|j|jƒ t ttj	dk r+dnd¡}|d	d„ ƒ}d
d„ }t|j|jƒ W d   ƒ d S 1 sJw   Y  d S )Nr	   Tc                   S   ó   dS ©z0 Docstring
            %(strtest3)s
            Nr   r   r   r   r   ÚfuncQ   ó    ztest_decorator.<locals>.funcc                   S   r!   )zP Docstring
            Another test
               with some indent
            Nr   r   r   r   r   ÚexpectedW   r$   z test_decorator.<locals>.expected)é   é   Fc                   S   r!   r"   r   r   r   r   r   r#   e   r$   c                   S   r!   )zX Docstring
                Another test
                   with some indent
            Nr   r   r   r   r   r%   j   r$   )
r   r   r   r   Úfilldocr   r   Ú__doc__ÚsysÚversion_info)r   Ú	decoratorr#   r%   r   r   r   Útest_decoratorJ   s"   

ÿÿ
"Ýr-   c                     s®   t ƒ �} | jtd� G dd„ dƒ‰ G ‡ fdd„dˆ ƒ}W d   ƒ n1 s%w   Y  t|jjˆ jjd ƒ t|jjˆ jjƒ |ƒ }t|jjˆ jjd ƒ t|jjˆ jjƒ d S )Nr	   c                   @   s   e Zd Zdd„ Zdd„ ZdS )z(test_inherit_docstring_from.<locals>.Fooc                 S   r!   )zDo something useful.Nr   ©Úselfr   r   r   r#   y   s   z-test_inherit_docstring_from.<locals>.Foo.funcc                 S   r!   )zSomething else.Nr   r.   r   r   r   Úfunc2}   r$   z.test_inherit_docstring_from.<locals>.Foo.func2N)Ú__name__Ú
__module__Ú__qualname__r#   r0   r   r   r   r   ÚFoox   s    r4   c                       s0   e Zd Ze ” ¡dd„ ƒZe ” ¡dd„ ƒZdS )z(test_inherit_docstring_from.<locals>.Barc                 S   r!   )z%(super)sABCNr   r.   r   r   r   r#   �   ó   z-test_inherit_docstring_from.<locals>.Bar.funcc                 S   s   d S )Nr   r.   r   r   r   r0   †   r5   z.test_inherit_docstring_from.<locals>.Bar.func2N)r1   r2   r3   r   Úinherit_docstring_fromr#   r0   r   ©r4   r   r   ÚBar€   s
    
r8   ÚABC)r   r   r   r   r#   r)   r0   )r   r8   Úbarr   r7   r   Útest_inherit_docstring_fromr   s   õr;   )r)   r*   ÚpytestÚnumpy.testingr   r   Ú
scipy._libr   ÚflagsÚoptimizeÚDOCSTRINGS_STRIPPEDr   r   r   r   r   r   r   r   r   ÚmarkÚskipifr-   r;   r   r   r   r   Ú<module>   s6    ÿÿÿÿþÿ
	
'