
    9g                     F   d Z ddlZddlZddlZddlZddlZddlmZ 	 ddlm	Z	m
Z
 ddlZddlmZ  eedd      r eed      r ej"                  d	d
e       ddlmZ erddlZi Zej0                  d        Zej0                  d        Zd Zd Zd Zy# e$ r i Z	i Z
Y yw xY w)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)Path)PYTEST_HEADER_MODULESTESTED_VERSIONS)__version__frozenF_MEIPASSignorez(?s).*MATPLOTLIBDATA.*)category)HAS_MATPLOTLIBc               #      K   ddl m}  | j                  j                  i d      5  d  d d d        y # 1 sw Y   y xY ww)Nr   )pyplotT)after_reset)
matplotlibr   stylecontext)plts    0lib/python3.12/site-packages/astropy/conftest.pyignore_matplotlibrcr   ,   s0      )			24		0 
1	0	0s   $A 4	A =A c               #      K   t        j                         } t        j                  d       d t        j                  |        yw)zjFixture that reduces thread switching interval.

    This makes it easier to provoke race conditions.
    gư>N)sysgetswitchintervalsetswitchinterval)olds    r   fast_thread_switchingr   6   s5      


!C$	#s   AAc                    ddl m} d|_        d|_        ddlm} d|_        dt        _        t        r~t        j                         5  t        j                  d       t        j                  t        j                         t        j                           t        j"                  d       d d d        t$        j&                  j)                  d	      t        _        t$        j&                  j)                  d
      t        _        t/        j0                  d      t$        j&                  d	<   t/        j0                  d      t$        j&                  d
<   t3        t$        j&                  d	         j5                  d      j7                          t3        t$        j&                  d
         j5                  d      j7                          d| j8                  _        dt<        d<   dt<        d<   dt<        d<   dt<        d<   t>        t@        d<   	 ddl!m"} t$        j&                  j)                  d      }|8t%        jF                         dz  }tI        |tK        |      z  d      } ||       y y # 1 sw Y   xY w# tL        $ r Y y w xY w)Nr   confP      FTr	   AggXDG_CONFIG_HOMEXDG_CACHE_HOMEastropy_configastropy_cacheastropyerfaPyERFAcythonCythonskimagezScikit-imageasdf_astropyzasdf-astropyAstropy)threadpool_limitsPYTEST_XDIST_WORKER_COUNT      )'r%   r   	max_width	max_linesastropy.utils.iersauto_downloadbuiltins_pytest_runningr   warningscatch_warningssimplefiltermatplotlibrc_cacheupdatemplrcParams
rcdefaultsuseosenvironget_xdg_config_home_orig_xdg_cache_home_origtempfilemkdtempr   joinpathmkdiroptionastropy_headerr   r   r   threadpoolctlr-   	cpu_countmaxintImportError)configr   	iers_confr-   xdist_worker_countmax_threadsthreads_per_workers          r   pytest_configurerU   B   s   DNDN 5#I#H$$&!!(+%%cll3NNGGEN	 ' &(ZZ^^4E%FH"$&JJNN3C$DH!$,$4$45E$FBJJ !#+#3#3O#DBJJ %	&'00;AAC$	%&//	:@@B#'FMM &,(#&.(#,5.),:.)!,OI

23  ZZ^^,GH),,.A-K!$[C8J4K%KQ!O01	 *I '&@  s   A"I"I/ "I,/	I;:I;c                    ddl m} |j                  d       |j                  d       ddlm} |j                  d       dt        _        t        rit        j                         5  t        j                  d       t        j                  j                  t               t        j                          d d d        t        j                   t         j"                  j%                  d       n!t        j                  t         j"                  d<   t        j&                   t         j"                  j%                  d	       y t        j&                  t         j"                  d	<   y # 1 sw Y   xY w)
Nr   r   r1   r2   r4   Fr	   r!   r"   )r%   r   resetr3   r5   r6   r   r7   r8   r9   r<   r=   r;   r:   clearrC   r@   rA   poprD   )rP   r   rQ   s      r   pytest_unconfigurerZ   |   s    JJ{JJ{ 5OOO$$H$$&!!(+LL 23$$& '
 %%-


()(0(F(F

$%$$,


'('/'D'D

#$ '&s   %AEE&c                     	 t          | j                  j                  d      sy| j	                          | j                  ddd       y# t        $ r Y yw xY w)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)__IPYTHON__	NameErrorstatsrB   ensure_newline
write_line)terminalreporters    r   pytest_terminal_summaryre      sd     !!%%h/##%	H    	  s   A	 		AA)__doc__r5   r@   r   rE   r7   pathlibr   pytest_astropy_header.displayr   r   rO   pytestr%   r   getattrhasattrfilterwarningsUserWarning"astropy.utils.compat.optional_depsr   r   r<   r:   fixturer   r   rU   rZ   re        r   <module>rr      s     	 
   T
   3% WS*%=HH&>U >     72tE>U  Os   B 	B B 