o
    h                     @   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   P/var/www/vscode/kcb/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    
	
'