
    c                     d    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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'
    z
)ioStringIOsysstdoutgetvaluestrip)	func_nameargskwargsf
old_stdouts        8lib/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   -   	     	Dr   c                      dS )zc
    This docstring should break the parsing.

    See Also
    --------
    : this is invalid
    Nr   r   r   r   _invalid_docstringr   8   r   r   c                  r    t          t          j        j        d          } |                     d          sJ d S )Nnumpydocz)This package provides the numpydoc Sphinxr   r   __main__render_object
startswithouts    r   test_renders_package_docstringr    C   s6    
(+9:
F
FC>>EFFFFFFFr   c                  r    t          t          j        j        d          } |                     d          sJ d S )Nznumpydoc.__main__z0Implementing `python -m numpydoc` functionality.r   r   s    r   test_renders_module_docstringr"   H   s7    
(+9;N
O
OC>>LMMMMMMMr   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%   M   s>    
')S 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_statusr+   T   s    #112 K !	z	"	" W W''(UVVVW W W W W W W W W W W W W W W W W W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   r*   s     r   test_validate_detects_errorsr1   ^   ss    
)9 C S=9S@@@@#339 K ?r   c                      t          t          j        j        d          } | dk    sJ t          j                            d          }|dk    sJ d S )Nr$    r   r.   r0   s     r   test_validate_perfect_docstringr4   l   sc    
)+U C "9#332 K !r   )r   r   r'   r   numpydoc.__main__r   r   r   r    r"   r%   r+   r1   r4   r   r   r   <module>r6      s    



 				      "  "  " J	 	 		 	 	G G G
N N N
6 6 6W W W  	 	 	 	 	r   