a
    j=ic                     @   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 u r2t|dr2|j}tj|dd}| ||S )Nc                 s   s   | ]}t |tV  qd S )N)
isinstancestr).0val r	   s/home/droni/.local/share/virtualenvs/DPS-5Je3_V2c/lib/python3.9/site-packages/pandas/tests/indexes/test_subclass.py	<genexpr>       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   sr   t g d} | dd}tg dtd}t|| ttj	dd| tddgdd	d
}|
 }t|j| d S )N)         r   string)r   r   r   r   r   r   r   r   )r   )columnsindex)r   insertr   objecttmZassert_index_equalr   r   randomZrandnZreset_indexr   )idxresultexpecteddfr	   r	   r
   "test_insert_fallback_to_base_index   s    r)   )__doc__numpyr   Zpandasr   r   Zpandas._testingZ_testingr#   r   r)   r	   r	   r	   r
   <module>   s
   