B
    de                 @   s  d Z ddlZddlZddlZddlZddlZyddlmZmZ W n e	k
r\   i Zi ZY nX ddl
Z
ddlmZ ddlmZ eeddreedrejd	d
ed ddlmZ erddlZeddgd i Ze
jdd Ze
jdd Zdd Zdd Zdd ZdS )z
This file contains pytest configuration settings that are astropy-specific
(i.e.  those that would not necessarily be shared by affiliated packages
making use of astropy's test runner).
    N)PYTEST_HEADER_MODULESTESTED_VERSIONS)__version__)!enable_deprecations_as_exceptionsfrozenFZ_MEIPASSignorez(?s).*MATPLOTLIBDATA.*)category)HAS_MATPLOTLIBrequests)Zinclude_astropy_deprecationsZmodules_to_ignore_on_importc           	   c   s2   ddl m}  | jji dd d V  W d Q R X d S )Nr   )pyplotT)Zafter_reset)
matplotlibr   stylecontext)Zplt r   ]/work/yifan.wang/ringdown/master-ringdown-env/lib/python3.7/site-packages/astropy/conftest.pyignore_matplotlibrc3   s    r   c              c   s&   t  } t d dV  t |  dS )zjFixture that reduces thread switching interval.

    This makes it easier to provoke race conditions.
    gư>N)sysgetswitchintervalsetswitchinterval)oldr   r   r   fast_thread_switching<   s    
r   c          	   C   s   ddl m} d|_dt_trXt . td t	
tj t  td W d Q R X tjdt_tjdt_td	tjd< td
tjd< ttjtjd d ttjtjd d d| j_dtd< dtd< dtd< dtd< ttd< d S )Nr   )confFTr   ZAggXDG_CONFIG_HOMEXDG_CACHE_HOMEZastropy_configZastropy_cacheastropyZerfaZPyERFAcythonCythonZskimagezScikit-imageZasdfZAstropy)astropy.utils.iersr   auto_downloadbuiltins_pytest_runningr	   warningscatch_warningssimplefiltermatplotlibrc_cacheupdater   rcParamsZ
rcdefaultsZuseosenvironget_xdg_config_home_orig_xdg_cache_home_origtempfilemkdtempmkdirpathjoinoptionZastropy_headerr   r   r   )config	iers_confr   r   r   pytest_configureH   s*    

r4   c          	   C   s   ddl m} |d dt_trRt $ td t	j
t t  W d Q R X tjd krjtjd ntjtjd< tjd krtjd ntjtjd< d S )Nr   )r   r   Fr   r   r   )r   r   resetr   r    r	   r!   r"   r#   r   r&   r%   r$   clearr*   r'   r(   popr+   )r2   r3   r   r   r   pytest_unconfigurem   s    




r8   c             C   sL   y
t   W n tk
r   dS X | jds0dS |   | jdddd dS )z;Output a warning to IPython users in case any tests failed.Nfaileda  Some tests may fail when run from the IPython prompt; especially, but not limited to tests involving logging and warning handling.  Unless you are certain as to the cause of the failure, please check that the failure occurs outside IPython as well.  See https://docs.astropy.org/en/stable/known_issues.html#failing-logging-tests-when-running-the-tests-in-ipython for more information.T)yellowbold)get_ipython	NameErrorstatsr)   Zensure_newlineZ
write_line)Zterminalreporterr   r   r   pytest_terminal_summary   s    
r?   )__doc__r'   r   r   r,   r!   Zpytest_astropy_header.displayr   r   ImportErrorZpytestr   r   Zastropy.tests.helperr   getattrhasattrfilterwarningsUserWarningZ"astropy.utils.compat.optional_depsr	   r   r$   Zfixturer   r   r4   r8   r?   r   r   r   r   <module>   s8   

	%