U
    ¾mœd2  ã                   @   s0   d dl Z d dlZd dlmZ G dd„ deƒZdS )é    N)ÚBaseExtensionTestsc                   @   sL   e Zd ZdZdd„ Zej dddg¡dd„ ƒZej dddg¡d	d
„ ƒZ	dS )ÚBaseAccumulateTestszj
    Accumulation specific tests. Generally these only
    make sense for numeric/boolean operations.
    c                 C   sj   t ||ƒ|d�}|jt ¡ kr@|dkr@|r@t d|› d|› �¡ t | d¡|ƒ|d�}| j||dd� d S )N©ÚskipnaZcumprodz4Float32 precision lead to large differences with op z and skipna=Zfloat64F)Zcheck_dtype)ÚgetattrZdtypeÚpdZFloat32DtypeÚpytestÚskipZastypeZassert_series_equal)ÚselfÚsÚop_namer   ÚresultÚexpected© r   ú_/home/sam/Atlas/atlas_env/lib/python3.8/site-packages/pandas/tests/extension/base/accumulate.pyÚcheck_accumulate   s    ÿz$BaseAccumulateTests.check_accumulater   TFc              	   C   s8   |}t  |¡}t t¡� t||ƒ|d� W 5 Q R X d S )Nr   )r   ÚSeriesr   ZraisesÚNotImplementedErrorr   ©r
   ÚdataZall_numeric_accumulationsr   r   Zserr   r   r   Útest_accumulate_series_raises   s    
z1BaseAccumulateTests.test_accumulate_series_raisesc                 C   s    |}t  |¡}|  |||¡ d S )N)r   r   r   r   r   r   r   Útest_accumulate_series!   s    
z*BaseAccumulateTests.test_accumulate_seriesN)
Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   ÚmarkZparametrizer   r   r   r   r   r   r      s   
r   )r   Zpandasr   Z pandas.tests.extension.base.baser   r   r   r   r   r   Ú<module>   s   