U
    ê‹Ñh  ã                   @   sx   d dl Z d dlZd dlZd dlmZ ej ddddddg¡d	d
„ ƒZdd„ Z	dd„ Z
dd„ Zdd„ Zdd„ Zdd„ ZdS )é    N)Ú_apiztarget,test_shape)©N)é   é   )©Nr   )r   )r   )r   é   ))r   é   )r   é	   ))Nr   N)r   r   r   c              	   C   sV   dt | ƒ› d�t d|› �¡ }t |¡}tjt|d�� tj	| |d� W 5 Q R X d S )Nz^'aardvark' must be zD.*z
has shape ©Úmatch)Zaardvark)
ÚlenÚreÚescapeÚnpÚzerosÚpytestÚraisesÚ
ValueErrorr   Zcheck_shape)ÚtargetZ
test_shapeZerror_patternÚdata© r   úG/tmp/user/2202/pip-unpacked-wheel-9k0_ldo3/matplotlib/tests/test_api.pyÚtest_check_shape	   s    ÿ
r   c               	   C   sT   G dd„ dƒ} t  tj¡� | j W 5 Q R X t  tj¡� | ƒ }|j W 5 Q R X d S )Nc                   @   s$   e Zd Ze d¡ejdd„ ƒƒZdS )z)test_classproperty_deprecation.<locals>.Az0.0.0c                 S   s   d S r   r   )Úclsr   r   r   Úf   s    z+test_classproperty_deprecation.<locals>.A.fN)Ú__name__Ú
__module__Ú__qualname__r   Ú
deprecatedZclasspropertyr   r   r   r   r   ÚA   s   r   )r   Úwarnsr   ÚMatplotlibDeprecationWarningr   )r   Úar   r   r   Útest_classproperty_deprecation   s    r#   c               	   C   s¬   G dd„ dƒ} | ƒ }t  tj¡� |jdks0t‚W 5 Q R X t  tj¡� d|_W 5 Q R X t  tj¡� |jdkstt‚W 5 Q R X t  tj¡� | d¡dksžt‚W 5 Q R X d S )Nc                   @   s0   e Zd Zdd„ Zdd„ Ze d¡Ze d¡ZdS )z-test_deprecate_privatize_attribute.<locals>.Cc                 S   s
   d| _ d S )Nr   )Z_attr)Úselfr   r   r   Ú__init__'   ó    z6test_deprecate_privatize_attribute.<locals>.C.__init__c                 S   s   |S r   r   )r$   Úargr   r   r   Ú_meth(   r&   z3test_deprecate_privatize_attribute.<locals>.C._methz0.0N)	r   r   r   r%   r(   r   Zdeprecate_privatize_attributeÚattrÚmethr   r   r   r   ÚC&   s   
r+   r   r   é*   )r   r    r   r!   r)   ÚAssertionErrorr*   )r+   Úcr   r   r   Ú"test_deprecate_privatize_attribute%   s    r/   c               
      s    t  dd¡ddd„ƒ‰ t  dd¡dd„ ƒ} ˆ | fD ],}|ƒ  t t j¡� |dd� W 5 Q R X q2t jjf‡ fd	d
„	}|ƒ  t t j¡� |dd� W 5 Q R X d S )Nú3.0Úfooc                 S   s   d S r   r   ©r1   r   r   r   Úfunc18   s    z$test_delete_parameter.<locals>.func1c                  [   s   d S r   r   )Úkwargsr   r   r   Úfunc2<   s    z$test_delete_parameter.<locals>.func2Úbarr2   c                    s   ˆ | ƒ d S r   r   r2   ©r3   r   r   Úpyplot_wrapperE   s    z-test_delete_parameter.<locals>.pyplot_wrapper)N)r   Zdelete_parameterr   r    r!   ÚdeprecationZ_deprecated_parameter)r5   Úfuncr8   r   r7   r   Útest_delete_parameter7   s    


r;   c               	   C   sl   t  dd¡d	dd„ƒ} | ddd� t t j¡� | ddƒ W 5 Q R X t t j¡� | dddƒ W 5 Q R X d S )
Nr0   r'   c                 S   s   d S r   r   )Úprer'   Úpostr   r   r   r:   N   s    z$test_make_keyword_only.<locals>.funcr   r   )r'   r   )N)r   Zmake_keyword_onlyr   r    r!   )r:   r   r   r   Útest_make_keyword_onlyM   s    
r>   c                  C   s,   d} t jd| d�dd„ ƒ}| |jks(t‚d S )Nz)`.f1`, `f2`, `f3(x) <.f3>` or `f4(x)<f4>`Ú1)Úalternativec                   S   s   d S r   r   r   r   r   r   r   \   s    z'test_deprecation_alternative.<locals>.f)r   r   Ú__doc__r-   )r@   r   r   r   r   Útest_deprecation_alternativeZ   s    
rB   c                	   C   s*   t jtdd�� t dg¡ W 5 Q R X d S )NzNo argument to check!r
   r"   )r   r   Ú	TypeErrorr   Zcheck_in_listr   r   r   r   Útest_empty_check_in_listb   s    rD   )r   Znumpyr   r   Z
matplotlibr   ÚmarkZparametrizer   r#   r/   r;   r>   rB   rD   r   r   r   r   Ú<module>   s$   üÿ
