o
    *ήcy                     @   s   d dl mZ d dlmZmZmZmZ d dlmZ d dl	m
Z
 d dlmZ d dlmZ d dlmZmZ dd	 Zd
d Zdd Zdd Zdd ZdS )    )wraps)threaded	xthreadedmemoize_property
deprecated)warns_deprecated_sympyBasic)Eq)Matrix)xyc                  C   sT  t dd } | tttgdtggddtdt d dt d gddt d ggks,J | tttddtdt d dt d ksDJ | ttgdddt d dt d gksZJ | ttfdddt d dt d fkspJ | tthdddt d dt d hksJ t dd } | tt dtd td  ksJ | tdtd ksJ d S )Nc                 W   s   d|  t | S )N   )sum)exprargs r   K/tmp/pip-target-vg8gfxp4/lib/python/sympy/utilities/tests/test_decorator.pyfunction   s   ztest_threaded.<locals>.function   r         c                 S      | | S Nr   r   nr   r   r   r         )r   r   r   r   r
   r   r   r   r   test_threaded   s   
*0,,,
"r   c                  C   s.   t dd } | tt dtt d ksJ d S )Nc                 S   r   r   r   r   r   r   r   r   %   r   z test_xthreaded.<locals>.functionr   )r   r   r   r   r   r   r   test_xthreaded$   s   
"r   c                  C   s^   dd } d| _ t| }t| |}|jdksJ |jdksJ t|ds&J |j du s-J d S )Nc                 S   s   dS )My function. Nr   r   r   r   r   my_func-   s    ztest_wraps.<locals>.my_funcTr"   r    
is_my_func)r#   r   r   __name____doc__hasattr)r"   new_my_funcr   r   r   
test_wraps,   s   r(   c                  C   s2   G dd dt } |  }|j}|j}||u sJ d S )Nc                   @   s   e Zd Zedd ZdS )z*test_memoize_property.<locals>.TestMemoizec                 S   s   t  S r   r   )selfr   r   r   prop=   s   z/test_memoize_property.<locals>.TestMemoize.propN)r$   
__module____qualname__r   r*   r   r   r   r   TestMemoize<   s    r-   )r	   r*   )r-   memberobj1obj2r   r   r   test_memoize_property;   s
   r1   c                  C   s  t dddddd } t  | ddksJ W d    n1 s!w   Y  t ddddG d	d
 d
}t  t| |s@J W d    n1 sJw   Y  t ddddG dd d}t  |ddksiJ W d    n1 ssw   Y  t ddddG dd d}t  |djdksJ W d    n1 sw   Y  t ddddG dd d}t  |ddksJ W d    n1 sw   Y  t  |djdksJ W d    d S 1 sw   Y  d S )Nz!deprecated_function is deprecatedz1.10zactive-deprecations)deprecated_since_versionactive_deprecations_targetc                 S   s   | S r   r   r!   r   r   r   deprecated_functionG   s   z,test_deprecated.<locals>.deprecated_functionr   zdeprecated_class is deprecatedc                   @   s   e Zd ZdS )z)test_deprecated.<locals>.deprecated_classN)r$   r+   r,   r   r   r   r   deprecated_classR   s    r5   z"deprecated_class_new is deprecatedc                   @      e Zd Zdd ZdS )z-test_deprecated.<locals>.deprecated_class_newc                 S   s   |S r   r   clsargr   r   r   __new__a   s   z5test_deprecated.<locals>.deprecated_class_new.__new__N)r$   r+   r,   r:   r   r   r   r   deprecated_class_new]       r;   z#deprecated_class_init is deprecatedc                   @   r6   )z.test_deprecated.<locals>.deprecated_class_initc                 S   
   d| _ d S Nr   r9   r)   r9   r   r   r   __init__k      
z7test_deprecated.<locals>.deprecated_class_init.__init__N)r$   r+   r,   rA   r   r   r   r   deprecated_class_initg   r<   rC   z'deprecated_class_new_init is deprecatedc                   @   s   e Zd Zdd Zdd ZdS )z2test_deprecated.<locals>.deprecated_class_new_initc                 S   s   |dkr|S t | S )Nr   )objectr:   r7   r   r   r   r:   u   s   
z:test_deprecated.<locals>.deprecated_class_new_init.__new__c                 S   r=   r>   r?   r@   r   r   r   rA   z   rB   z;test_deprecated.<locals>.deprecated_class_new_init.__init__N)r$   r+   r,   r:   rA   r   r   r   r   deprecated_class_new_initq   s    rE   r   )r   r   
isinstancer9   )r4   r5   r;   rC   rE   r   r   r   test_deprecatedF   sV   
	"rG   N)	functoolsr   sympy.utilities.decoratorr   r   r   r   sympy.testing.pytestr   sympy.core.basicr	   sympy.core.relationalr
   sympy.matrices.denser   	sympy.abcr   r   r   r   r(   r1   rG   r   r   r   r   <module>   s    