B
    [	                 @   s   d dl mZmZ 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 )    )print_functiondivisionNT)LooseVersion)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 rr||d = |d |= d S )Nz--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)	sessionconfigitemssplitmitstartend r   -lib/python3.7/site-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rr|d	krZdd l}n|d
krjd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.core.compatibilityr   r   r   Zgmpy2version)r   r   sr   r   r   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)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 )Nz--splitZstorer   zsplit tests)actiondefaulthelp)Z	addoption)parserr   r   r   pytest_addoption6   s    
r-   c             C   s   t | || dS )z pytest hook. N)r   )r   r   r   r   r   r   pytest_collection_modifyitems;   s    r.   module)ZautouseZscopec               C   s
   t   d S )N)r   r   r   r   r   file_clear_cacheA   s    r0   c             C   sT   t | jddrtd n6t | jddrPttjdk rPtjddkrPtd d S )	NZdisabledFztest requirements not met.Zipythonz2.6.3z-sZnoz0run py.test with -s or upgrade to newer version.)getattrr/   pytestskipV__version__r   getvalue)Zrequestr   r   r   check_disabledE   s    r7   )Z
__future__r   r   sysZ_running_pytestZdistutils.versionr   r4   r2   r!   r   recompiler   r   r$   r(   r-   r.   Zfixturer0   r7   r   r   r   r   <module>   s   
