o
    l¨ÊhO	  ã                   @   sL   d Z ddlmZ G dd„ deƒZG dd„ deƒZdd„ Zd	d
„ Zdd„ ZdS )z+
Test my automatically generate exceptions
é    )Úmy_exceptionsc                   @   s   e Zd Zdd„ ZdS )ÚCustomExceptionc                 C   s    ||||f\| _ | _| _| _d S ©N)ÚaÚbÚcÚd)Úselfr   r   r   r   © r
   úP/var/www/html/env/lib/python3.10/site-packages/joblib/test/test_my_exceptions.pyÚ__init__   s    zCustomException.__init__N)Ú__name__Ú
__module__Ú__qualname__r   r
   r
   r
   r   r      s    r   c                   @   s   e Zd ZdZdd„ ZdS )ÚCustomException2zˆA custom exception with a .args attribute

    Just to check that the JoblibException created from it
    has it args set correctly
    c                 G   s   || _ || _d S r   )r   Úargs)r	   r   r   r
   r
   r   r      s   
zCustomException2.__init__N)r   r   r   Ú__doc__r   r
   r
   r
   r   r      s    r   c                   C   sB   t t ¡ tƒs	J ‚t t ¡ tjƒsJ ‚tjt t¡d u sJ ‚d S )Nr   )Ú
isinstancer   ÚJoblibNameErrorÚ	NameErrorÚJoblibExceptionÚ_mk_exceptionr
   r
   r
   r   Útest_inheritance   s   ÿÿr   c                  C   sv   t  t¡d t ju sJ ‚t jt jfD ]} t  | ¡d | u sJ ‚qtdd„ ƒtg}|D ]}t  |¡d t ju s8J ‚q*d S )Nr   c                   S   s   d S r   r
   r
   r
   r
   r   Ú<lambda>0   s    z0test_inheritance_special_cases.<locals>.<lambda>)r   r   Ú	Exceptionr   ÚTransportableExceptionÚtypeÚbool)Úexception_typeÚnon_inheritable_classesÚ	exceptionr
   r
   r   Útest_inheritance_special_cases   s   ÿÿ
ÿ
ÿÿr!   c                  C   s~   t ttttttfD ]3} d}t | ¡d |dddddƒ}t	|ƒ}t
|| ƒs&J ‚t
|tjƒs.J ‚|jj|v s6J ‚||v s<J ‚q	d S )Nz,This message should be in the exception reprr   ÚsomeÚotherr   zthat are notzin the repr)r   Ú	TypeErrorÚSyntaxErrorÚ
ValueErrorÚImportErrorr   r   r   r   Úreprr   r   Ú	__class__r   )ÚklassÚmessageÚexcÚexc_reprr
   r
   r   Útest__mk_exception6   s   ÿÿör.   N)	r   Újoblibr   r   r   r   r   r!   r.   r
   r
   r
   r   Ú<module>   s    