U
    L?h
                     @   s   d dl Z de _d dlmZ d dlZd dlmZmZ d dlm	Z	 d dl
mZ d dlZz(d dlZejjddd ejd W n ek
r   ed	Y nX ed
Zdd Zdd Zdd Zdd Zdd Zejddddd Zejddddd ZdS )    NT)version_tuple)clear_cache	USE_CACHE)GROUND_TYPES)ARCHZsympy_hypothesis_profile)deadlinezhypothesis is a required dependency to run the SymPy test suite. Install it with 'pip install hypothesis' or 'conda install -c conda-forge hypothesis'z([0-9]+)/([1-9][0-9]*)c                 C   s   |  d}|sd S t|}|s(tdtt| \}}|d t| | |t| |  }}||k rr||d = |d |= d S )N--splitz>split must be a string of the form a/b where a and b are ints.   )Z	getoptionspmatch
ValueErrormapintgroupslen)configitemssplitmitstartend r   @/var/www/html/venv/lib/python3.8/site-packages/sympy/conftest.pyprocess_split   s    

&
r   c                 C   s   dt  }|dt 7 }d}tdkr2dd l}| }n>tdkrpzddlm} W n tk
rb   d}Y nX d	| d
}|dt|f 7 }|S )Nzarchitecture: %s
zcache:        %s
 Zgmpyr   flint)__version__unknownz(python-flint==)zground types: %s %s
)r   r   r   gmpy2versionr   r   ImportError)r   sr"   r!   r   r   r   r   pytest_report_header-   s    

r%   c                 C   s2   | j dd s| j dd r.| jddddd d S )NerrorZfailed zDO *NOT* COMMIT!T)redbold)statsgetZ	write_sep)Zterminalreporterr   r   r   pytest_terminal_summary@   s
     r,   c                 C   s   | j ddddd d S )Nr   storer   zsplit tests)actiondefaulthelp)Z	addoption)parserr   r   r   pytest_addoptionG   s    r2   c                 C   s   t | | dS )zpytest hook.N)r   )r   r   r   r   r   pytest_collection_modifyitemsK   s    r3   module)Zautousescopec                   C   s
   t   d S )N)r   r   r   r   r   file_clear_cacheQ   s    r6   c                 C   sX   t | jddrtd n:t | jddrTttjtdk rTtjddkrTtd d S )	NdisabledFztest requirements not met.ipythonz2.6.3z-snoz0run py.test with -s or upgrade to newer version.)getattrr4   pytestskipr   r   r   getvalue)requestr   r   r   check_disabledV   s    r?   )sysZ_running_pytestZsympy.external.importtoolsr   r;   Zsympy.core.cacher   r   Zsympy.external.gmpyr   Zsympy.utilities.miscr   reZ
hypothesissettingsZregister_profileZload_profiler#   compiler
   r   r%   r,   r2   r3   Zfixturer6   r?   r   r   r   r   <module>   s2   


