U
    sVc                     @   sd   d Z ddlZddlZddlmZ ddlmZ G dd deZ	ej
dd ZG dd	 d	Zd
d ZdS )zB
Tests for behavior if an author does *not* implement EA methods.
    N)ExtensionArrayc                   @   s   e Zd ZddddZdS )MyEAN)returnc                 C   s
   || _ d S N)Z_values)selfvalues r   I/tmp/pip-unpacked-wheel-xj8nt62q/pandas/tests/extension/test_extension.py__init__   s    zMyEA.__init__)__name__
__module____qualname__r
   r   r   r   r	   r      s   r   c                  C   s   t d} t| S )N
   )npZaranger   )Zarrr   r   r	   data   s    
r   c                   @   s   e Zd Zdd ZdS )TestExtensionArrayc              	   C   s(   |}t t t|| W 5 Q R X d S r   )pytestZraisesAttributeErrorgetattr)r   r   Zall_arithmetic_operatorsZop_namer   r   r	   test_errors   s    zTestExtensionArray.test_errorsN)r   r   r   r   r   r   r   r	   r      s   r   c               
   C   sN   d} t jt| d2 G dd dt}t d  |  W 5 Q R X W 5 Q R X d S )Nz<The `na_sentinel` argument of `MyEA.factorize` is deprecated)matchc                   @   s   e Zd ZdddZdS )z#test_depr_na_sentinel.<locals>.MyEAc                 S   s   d S r   r   )r   Zna_sentinelr   r   r	   	factorize$   s    z-test_depr_na_sentinel.<locals>.MyEA.factorizeN)r   )r   r   r   r   r   r   r   r	   r   #   s   r   )tmZassert_produces_warningDeprecationWarningr   )msgr   r   r   r	   test_depr_na_sentinel   s
    r   )__doc__Znumpyr   r   Zpandas._testingZ_testingr   Zpandas.core.arraysr   r   Zfixturer   r   r   r   r   r   r	   <module>   s   
