U
    sVc                     @   sD   d Z ddlZddlmZmZ ddlmZ G dd deZ	dd Z
dS )z)
Tests involving custom Index subclasses
    N)	DataFrameIndexc                   @   s   e Zd ZdddZdS )CustomIndexNc                 C   sL   t dd |D rtd|d kr2t|dr2|j}tj|dd}| ||S )Nc                 s   s   | ]}t |tV  qd S )N)
isinstancestr).0val r	   F/tmp/pip-unpacked-wheel-xj8nt62q/pandas/tests/indexes/test_subclass.py	<genexpr>   s     z&CustomIndex.__new__.<locals>.<genexpr>zCustomIndex cannot hold stringsnameOZdtype)any	TypeErrorhasattrr   nparrayZ_simple_new)clsdatar   r	   r	   r
   __new__   s    zCustomIndex.__new__)N)__name__
__module____qualname__r   r	   r	   r	   r
   r      s   r   c                  C   sx   t dddg} | dd}tddddgtd}t|| ttj	dd| tddgddd}|
 }t|j| d S )	N         r   stringr   )r   )columnsindex)r   insertr   objecttmZassert_index_equalr   r   randomZrandnZreset_indexr   )idxresultexpectedZdfr	   r	   r
   "test_insert_fallback_to_base_index   s      r'   )__doc__Znumpyr   Zpandasr   r   Zpandas._testingZ_testingr"   r   r'   r	   r	   r	   r
   <module>   s
   