o
    X۷i                  
   @  s   d dl mZ d dlZd dlZzd dlZd dlZdZW n ey2 Z	 zdZdZe	ZW Y dZ	[	ndZ	[	ww dd Z
dd Ze
 rEG dd dZd	d
ddZdS )    )annotationsNc                   C  s   t d u ottdS )Nfixture)_errorhasattrpytest r   r   O/home/ubuntu/vllm_env/lib/python3.10/site-packages/cupy/testing/_pytest_impl.pyis_available   s   r	   c                 C  s"   t  std| ttjtd S )Nz2cupy.testing: {} is not available.

Reason: {}: {})r	   RuntimeErrorformattyper   __name__)featurer   r   r   check_available   s
   r   c                      s0   e Zd Z fddZejdddd Z  ZS )_TestingParameterizeMixinc                   s   d t  | jS )Nz<{}  parameter: {}>)r   super__repr____dict__)self	__class__r   r   r   !   s   z"_TestingParameterizeMixin.__repr__T)autousec                 C  s   | j rJ d| j | d S )Nz9There should not be another hack with instance attribute.)r   update)r   _cupy_testing_paramr   r   r   _cupy_testing_parameterize'   s   z4_TestingParameterizeMixin._cupy_testing_parameterize)r   
__module____qualname__r   r   r   r   __classcell__r   r   r   r   r      s    
r   T)_idsc                   sF   t d | rtjjj ndd   fddtD fdd}|S )Nparameterizec                 S  s   t |S )N)str)_iparamr   r   r   
param_name3   s   z parameterize.<locals>.param_namec                   s&   g | ]\}}t j| d ||dqS ) )id)r   r#   ).0r"   r#   )r$   r   r   
<listcomp>:   s    z parameterize.<locals>.<listcomp>c                   sV   t | tjrJ t | trtd| j}t| jt| fi } || _tj	
d | } | S )Nz$do not `@testing.parameterize` twicer   )
issubclassunittestTestCaser   r
   r   r   r   r   markparametrize)clsmodule_name)paramsr   r   f?   s   
zparameterize.<locals>.f)r   cupytesting_parameterized_make_class_name	enumerate)r   r0   r1   r   )r$   r0   r   r   .   s   
	r   )
__future__r   r*   cupy.testing._parameterizedr2   r   _pytestr   ImportErrorer	   r   r   r   r   r   r   r   <module>   s$    