U
    »mœdš  ã                   @   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   sR   t ƒ �B} | jtd� tt t¡tƒ tt t¡tƒ tt t¡tƒ W 5 Q R X d S )N©Úcategory)	r   ÚfilterÚDeprecationWarningr   r   Zunindent_stringÚ
param_doc1Ú
param_doc2Ú
param_doc3)Úsup© r   úU/home/sam/Atlas/atlas_env/lib/python3.8/site-packages/scipy/misc/tests/test_doccer.pyÚtest_unindent+   s
    r   c               	   C   sb   t ƒ �} | jtd� t t¡}W 5 Q R X 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   Zd2r   r   r   Útest_unindent_dict3   s    r   c               	   C   s\   t ƒ �L} | jtd� t t¡}t t|¡}t|t	ƒ d}t |t¡}t|dƒ W 5 Q R X d S )Nr	   zSingle line doc %(strtest1)sz0Single line doc Another test
   with some indent)
r   r   r   r   r   r   Z	docformatÚ	docstringr   Úfilled_docstring)r   ZuddÚ	formattedZ
single_docr   r   r   Útest_docformat<   s    

r   zdocstrings stripped)Úreasonc               	   C   sj   t ƒ �Z} | jtd� t td¡}|dd„ ƒ}t|jdƒ t td¡}|dd„ ƒ}t|jdƒ W 5 Q R X d S )	Nr	   Tc                   S   s   dS ©z0 Docstring
            %(strtest3)s
            Nr   r   r   r   r   ÚfuncQ   s    ztest_decorator.<locals>.funczP Docstring
            Another test
               with some indent
            Fc                   S   s   dS r   r   r   r   r   r   r   ^   s    zX Docstring
                Another test
                   with some indent
            )r   r   r   r   Zfilldocr   r   Ú__doc__)r   Ú	decoratorr   r   r   r   Útest_decoratorJ   s    

r    c               	      sš   t ƒ �4} | jtd� G dd„ dƒ‰ G ‡ fdd„dˆ ƒ}W 5 Q R X 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   s   dS )zDo something useful.Nr   ©Úselfr   r   r   r   p   s    z-test_inherit_docstring_from.<locals>.Foo.funcc                 S   s   dS )zSomething else.Nr   r!   r   r   r   Úfunc2t   s    z.test_inherit_docstring_from.<locals>.Foo.func2N)Ú__name__Ú
__module__Ú__qualname__r   r#   r   r   r   r   ÚFooo   s   r'   c                       s0   e Zd Ze ” ¡dd„ ƒZe ” ¡dd„ ƒZdS )z(test_inherit_docstring_from.<locals>.Barc                 S   s   dS )z%(super)sABCNr   r!   r   r   r   r   x   s    z-test_inherit_docstring_from.<locals>.Bar.funcc                 S   s   d S )Nr   r!   r   r   r   r#   }   s    z.test_inherit_docstring_from.<locals>.Bar.func2N)r$   r%   r&   r   Zinherit_docstring_fromr   r#   r   ©r'   r   r   ÚBarw   s   
r)   ÚABC)r   r   r   r   r   r   r#   )r   r)   Úbarr   r(   r   Útest_inherit_docstring_fromi   s    r,   )r   ÚsysZpytestZnumpy.testingr   r   Z
scipy._libr   ÚflagsÚoptimizeZDOCSTRINGS_STRIPPEDr   r   r   r   r   r   r   r   r   ÚmarkZskipifr    r,   r   r   r   r   Ú<module>   s4   ÿÿÿÿþÿ
	
