o
    8Va                     @   s   d dl Z de _d dlmZ d dlZd dlmZ d dlZ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_cachez([0-9]+)/([1-9][0-9]*)c                 C   s   |  d}|s	d S t|}|stdtt| \}}|d t| | |t| | }}||k r9||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   0/usr/lib/python3/dist-packages/sympy/conftest.pyprocess_split   s   

&
r   c                 C   s   ddl m} d| }ddlm} |d| 7 }ddlm}m} d}|dkr9|d	kr-dd l}n|d
kr5dd l}|	 }|d||f 7 }|S )Nr   )ARCHzarchitecture: %s
)	USE_CACHEzcache:        %s
)GROUND_TYPESHAS_GMPY gmpyr      zground types: %s %s
)
Zsympy.utilities.miscr   sympy.core.cacher   Zsympy.external.gmpyr   r   r   Zgmpy2version)r   r   sr   r   r   r!   r   r   r   r   pytest_report_header   s   
r#   c                 C   s6   | j dd s| j dd r| jddddd d S d S )NerrorZfailed zDO *NOT* COMMIT!T)ZredZbold)Z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_addoption4   s   

r-   c                 C   s   t | | dS )z pytest hook. N)r   )r   r   r   r   r   pytest_collection_modifyitems9   s   r.   module)ZautouseZscopec                   C   s
   t   d S )Nr   r   r   r   r   file_clear_cache?   s   
r0   c                 C   sf   t | jddrtd d S t | jddr-ttjtdk r/tjddkr1td d S d S d S d S )	NZdisabledFztest requirements not met.Zipythonz2.6.3z-snoz0run py.test with -s or upgrade to newer version.)getattrr/   pytestskipr   __version__r   getvalue)Zrequestr   r   r   check_disabledC   s   r7   )sysZ_running_pytestZsympy.external.importtoolsr   r3   r    r   recompiler   r   r#   r'   r-   r.   Zfixturer0   r7   r   r   r   r   <module>   s     

