B
    Mô`±	  ã               @   sx   d dl Z d dlZd dlZd dlmZ d dlZd dlZd dlmZ	 d dl
mZ dd„ Zdd„ Zd	d
„ Zdd„ Zdd„ ZdS )é    N)ÚPath)Úpyplot)ÚMatplotlibDeprecationWarningc          
   C   s´   t tjƒjd d }| ¡ s&t d¡ t tjƒ ¡ }|  	d¡}| 
|d¡ tjtjt|ƒt|ƒgdd� | d¡}||kr°d 	tj| d¡| d¡d	d
ddd�¡}t d| ¡ d S )Né   ztools/boilerplate.pyzboilerplate.py not foundz	pyplot.pyzutf-8T)ÚcheckÚ
zfound pyplot.pyzexpected pyplot.pyr   Ú )ZfromfileZtofileÚnZlinetermzøpyplot.py is not up-to-date. Please run 'python tools/boilerplate.py' to update pyplot.py. This needs to be done from an environment where your current working copy is installed (e.g. 'pip install -e'd). Here is a diff of unexpected differences:
%s)r   ÚmplÚ__file__ÚparentsÚexistsÚpytestÚskipÚpltÚ	read_textÚjoinÚ
write_textÚ
subprocessÚrunÚsysÚ
executableÚstrÚdifflibZunified_diffÚsplitÚfail)ZtmpdirZ
gen_scriptZorig_contentsZplt_fileZnew_contentsZdiff_msg© r   ú@/tmp/pip-unpacked-wheel-0c1wfn4v/matplotlib/tests/test_pyplot.pyÚtest_pyplot_up_to_date   s&    


r   c          	   C   s²   t j ddd¡t j dd¡ddd„ƒƒ}t |¡ddd„ƒ}|d ƒ |d d	� |d d d
� |d d d� | rnt‚t t	¡� |d d� W d Q R X t t	¡� |d d ƒ W d Q R X d S )Nz	(version)ÚoldÚnewÚkwoc             S   s   d S )Nr   )r    r!   r   r   r   Úfunc*   s    z1test_copy_docstring_and_deprecators.<locals>.funcc             S   s   d S )Nr   )r    r!   r   r   r   Úwrapper_func/   s    z9test_copy_docstring_and_deprecators.<locals>.wrapper_func)r    )r!   )r    r!   )r   )N)N)
r
   ZcbookZ_rename_parameterZ_make_keyword_onlyr   Z_copy_docstring_and_deprecatorsÚAssertionErrorr   Zwarnsr   )Zrecwarnr"   r#   r   r   r   Ú#test_copy_docstring_and_deprecators)   s    
r%   c              C   sd   t  ¡ \} }t  d¡ | ¡ r"t‚t  d¡ | ¡ s8t‚t  ¡  | ¡ rLt‚t  ¡  | ¡ s`t‚d S )NFT)r   ZsubplotsZboxZget_frame_onr$   )ZfigZaxr   r   r   Útest_pyplot_box>   s    

r&   c               C   s   t  dddgdddg¡ d S )Né   r   é   )r   Z	stackplotr   r   r   r   Útest_stackplot_smokeJ   s    r)   c            	   C   sH   t  t¡� tjdd� W d Q R X t  t¡� tjdd� W d Q R X d S )Nr'   )Znrows)Zncols)r   ZraisesÚ	TypeErrorr   Zsubplotr   r   r   r   Útest_nrows_errorO   s    r+   )r   r   r   Úpathlibr   r   Z
matplotlibr
   r   r   Zmatplotlib.cbookr   r   r%   r&   r)   r+   r   r   r   r   Ú<module>   s   