U
    ZÊ¹j×
  ã                   @   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)Údeadlinez–hypothesis 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   úM/var/www/html/bwave/python/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   ÿ


