U
    >vf2                     @   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   J/tmp/pip-unpacked-wheel-vdrwu74i/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   