
    -Ph                         d dl Z d dlZd dlZd dlZd dlZd dlZd Zd Zd Zd Z	d Z
d Zd Zd	 Zd
 Zej                            dg g dg          d             Zd ZdS )    Nc                     t          j                    }|t          j        ct          _        }	  | |i | |                                                    d          |t          _        S # |t          _        w xY w)a+  
    Return stdout of calling `func_name`.

    This docstring should be perfect, as it is used to test the
    validation with a docstring without errors.

    Parameters
    ----------
    func_name : callable
        Function to be called.
    *args, **kwargs
        Will be passed to `func_name`.

    Returns
    -------
    str
        The content that the function printed.

    See Also
    --------
    sys.stdout : Python's file handler for stdout.

    Examples
    --------
    >>> _capture_stdout(print, "hello world")
    'hello world'
    
)ioStringIOsysstdoutgetvaluestrip)	func_nameargskwargsf
old_stdouts        X/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/numpydoc/tests/test_main.py_capture_stdoutr      sn    8 	A
CJ
 	4"6"""zz||!!&))

Z
s   .A) )A7c                      dS )zi
    this docstring should report some errors

    Parameters
    ----------
    made_up_param : str
    N r       r   _docstring_with_errorsr   0         r   c                      dS )zc
    This docstring should break the parsing.

    See Also
    --------
    : this is invalid
    Nr   r   r   r   _invalid_docstringr   :   r   r   c                  r    t          t          j        j        d          } |                     d          sJ d S )Nnumpydocz)This package provides the numpydoc Sphinxr   r   clirender_object
startswithouts    r   test_renders_package_docstringr!   D   s5    
(,4j
A
AC>>EFFFFFFFr   c                     t           j                            ddg           |                                 j                            d          }|                    t           j        j                  sJ d S )Nrenderznumpydoc.clir   )r   r   main
readouterrr    r
   r   __doc__)capsysr    s     r   test_renders_module_docstringr(   I   sb    Lx0111





!
'
'
/
/C>>(,.///////r   c                  r    t          t          j        j        d          } |                     d          sJ d S )N(numpydoc.tests.test_main._capture_stdoutzReturn stdout of callingr   r   s    r   test_renders_function_docstringr+   O   s=    
"$N C >>45555555r   c                      t           j                            d          } | dk    sJ t          j        t
                    5  t           j                            d           d d d            d S # 1 swxY w Y   d S )Nr*   r   z+numpydoc.tests.test_main._invalid_docstring)r   r   r   pytestraises
ValueError)exit_statuss    r   .test_render_object_returns_correct_exit_statusr1   V   s    ,,,-WXXK!	z	"	" R R""#PQQQR R R R R R R R R R R R R R R R R Rs    A..A25A2c                      t          t          j        j        d          } d| v sJ d| v sJ t          j                            d          }|dk    sJ d S )Nz/numpydoc.tests.test_main._docstring_with_errorsSS02z,Summary does not start with a capital letterr   r   r   r   validate_objectr    r0   s     r   test_validate_detects_errorsr7   ^   si    
$9 C S====9S@@@@,..9 K ??????r   c                      t          t          j        j        d          } | dk    sJ t          j                            d          }|dk    sJ d S )Nr*    r   r4   r6   s     r   test_validate_perfect_docstringr:   l   s^    
$&P C "9999,..2 K !r   r   )--ignoreES01SA01EX01c                    ddg|z   }|rd}d}nt          j        d          }d}t          j                            |          }|                                 j                            d          }||k    sJ ||k    sJ d S )Nlintznumpydoc/__main__.pyr9   r   a*  
            +------------------------+----------+---------+----------------------------+
            | file                   | item     | check   | description                |
            +========================+==========+=========+============================+
            | numpydoc/__main__.py:1 | __main__ | ES01    | No extended summary found  |
            +------------------------+----------+---------+----------------------------+
            | numpydoc/__main__.py:1 | __main__ | SA01    | See Also section not found |
            +------------------------+----------+---------+----------------------------+
            | numpydoc/__main__.py:1 | __main__ | EX01    | No examples section found  |
            +------------------------+----------+---------+----------------------------+
           r   )inspectcleandocr   r   r$   r%   errr
   )r'   r   argvexpectedexpected_statusreturn_statusrD   s          r   	test_lintrI   x   s    *+d2D #

 
 L%%d++M





!
'
'
/
/C(????O++++++r   c                    t          j        t                    5  t          j                            ddg          }|dk    sJ 	 ddd           n# 1 swxY w Y   |                                 j        }d|v sJ d|v sJ dS )z*Test that lint help section is displaying.r@   z--helpr   Nr;   z--config)r-   r.   
SystemExitr   r   r$   r%   r    )r'   return_coder    s      r   test_lint_helprM      s     
z	"	"    l''(:;;a                              




!Cs   *AAA)rB   r   r   r-   r   numpydoc.clir   r   r   r!   r(   r+   r1   r7   r:   markparametrizerI   rM   r   r   r   <module>rQ      s     				 



      "  "  " J    G G G
0 0 06 6 6R R R  	 	 	 "&J&J&J!KLL, , ML,6	 	 	 	 	r   