U
    sVc                     @   s`   d Z ddlZddlZddlmZ ddlmZ ddl	m
Z
 dd Zejdejdgdd	 ZdS )
zg
Though Index.fillna and Series.fillna has separate impl,
test here to confirm these works as the same
    N)
MultiIndex)allow_na_opsc              	   C   sz   | }t |tr:d}tjt|d |d W 5 Q R X d S t|dkrP|jd nd}||}t	|| ||k	svt
d S )Nz"isna is not defined for MultiIndex)matchr   )
isinstancer   pytestZraisesNotImplementedErrorfillnalenvaluestmassert_equalAssertionError)index_or_series_objobjmsg
fill_valueresult r   A/tmp/pip-unpacked-wheel-xj8nt62q/pandas/tests/base/test_fillna.pytest_fillna   s    

r   null_objc                 C   s   |}t |}t|s&t| d n4t|dk r>td nt|trZtd|  d |j}|d }| }| |dd< ||dd< ||}||}|	|}t
|| ||k	std S )Nz  doesn't allow for NA operations   z%Test doesn't make sense on empty datazMultiIndex can't hold ''r      )typer   r   skipr	   r   r   Z_valuescopyr   r   r   r   )r   r   r   klassr
   r   expectedr   r   r   r   test_fillna_null"   s$    

r   )__doc__Znumpynpr   Zpandasr   Zpandas._testingZ_testingr   Zpandas.tests.base.commonr   r   markZparametrizenanr   r   r   r   r   <module>   s   