
    gB                        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	Z	 e	j                  d       dZ e j                  e      ZdZ	  eej$                  j'                  dd            Zeej(                  j*                  _        erej1                  d       nej1                  d       d	 Zd
 Zd Z ej8                         d        Z ej8                         d        Zd Zy# e$ r dZY w xY w# e$ r Y tw xY w)    N)PYTHON_IMPL_WASMaggTFSM_TEST_COPY_ON_WRITEzCopy on Write Enabled!zCopy on Write disabledc                     | j                  ddd       | j                  ddd       | j                  ddd       | j                  d	dd
       | j                  ddd       | j                  ddd       y )N--skip-slow
store_truezskip slow tests)actionhelp--only-slowzrun only slow tests--skip-exampleszskip tests of examples--skip-matplotlibz$skip tests that depend on matplotlib--skip-smokezskip smoke tests--only-smokezrun only smoke tests)	addoption)parsers    G/var/www/html/venv/lib/python3.12/site-packages/statsmodels/conftest.pypytest_addoptionr   !   s    
]<+  -
]</  1
&|2  4
(@  B
^L,  .
^L0  2    c                 B   d| j                   v r0| j                  j                  d      rt        j                  d       d| j                   vr0| j                  j                  d      rt        j                  d       d| j                   v r0| j                  j                  d      rt        j                  d       d	| j                   v r0| j                  j                  d
      rt        j                  d       d	| j                   v rt
        st        j                  d       d| j                   v r0| j                  j                  d      rt        j                  d       d| j                   vr2| j                  j                  d      rt        j                  d       y y y )Nslowr   zskipping due to --skip-slowr   zskipping due to --only-slowexampler   zskipping due to --skip-examples
matplotlibr   z!skipping due to --skip-matplotlibz)skipping since matplotlib is not intalledsmoker   zskipping due to --skip-smoker   zskipping due to --only-smoke)keywordsconfig	getoptionpytestskipHAVE_MATPLOTLIB)items    r   pytest_runtest_setupr!   0   s%   4;;#8#8#G12T]]"t{{'<'<]'K12DMM!dkk&;&;<M&N56t}}$KK!!"5678t}}$_?@$--DKK$9$9.$I23dmm#(=(=n(M23 )N#r   c                     	 dd l } |j                  d       	 ddlm}  |        y # t        $ r Y y w xY w# t        $ r Y y w xY w)Nr   r   )register_matplotlib_converters)r   usepandas.plottingr#   ImportError)r   r   r#   s      r   pytest_configurer'   H   sI    	
u	F*, 		 s#   6 ' 	36 36 	AAc               #   \   K   	 ddl fd} |   |         y# t        $ r d } Y w xY ww)a  
    Fixture that closes all figures after a test function has completed

    Returns
    -------
    closer : callable
        Function that will close all figures when called.

    Notes
    -----
    Used by passing as an argument to the function that produces a plot,
    for example

    def test_some_plot(close_figures):
        <test code>

    If a function creates many figures, then these can be destroyed within a
    test function by calling close_figures to ensure that the number of
    figures does not become too large.

    def test_many_plots(close_figures):
        for i in range(100000):
            plt.plot(x,y)
            close_figures()
    r   Nc                  <     j                   j                  d       y )Nall)pyplotclose)r   s   r   r,   zclose_figures.<locals>.closes   s    ##E*r   c                       y )N r.   r   r   r,   zclose_figures.<locals>.closew   s    r   )matplotlib.pyplotr&   )r,   r   s    @r   close_figuresr0   U   s5     6 	+ K	G  	s   ,	 ,),),c               #      K   t         j                  j                         } t         j                  j                  d       d t         j                  j	                  |        yw)a'  
    Fixture that set the global RandomState to the fixed seed 1

    Notes
    -----
    Used by passing as an argument to the function that uses the global
    RandomState

    def test_some_plot(reset_randomstate):
        <test code>

    Returns the state after the test function exits
       N)nprandom	get_stateseed	set_state)states    r   reset_randomstater9   ~   s?      II!EIINN1	IIs   A"A$c                    t         r|D ]~  }d|j                  v s|j                  d      }|s&t        |j                        }d|d<   t        j                  j                  di |}|j                  |       ||j                  d<    y y )NxfailFstrictr.   )	r   r   get_closest_markerdictkwargsr   markr;   
add_marker)r   itemsr    r@   
new_kwargsnew_marks         r   pytest_collection_modifyitemsrE      s     
	6D$--'..w7 "&dkk!2J+0Jx(%{{00>:>HOOH--5DMM'*
	6 	r   ) loggingosnumpyr3   pandaspdr   statsmodels.compat.pythonr   r   r$   r   r&   	getLogger__name__loggercowboolenvirongetoptionsmodecopy_on_writeAttributeErrorcriticalr   r!   r'   fixturer0   r9   rE   r.   r   r   <module>rY      s    	    6JNN5O
 
		8	$	
rzz~~5u=
>C$'BJJOO! 
OO,-
OO,-240
 % %P  4W  O  		s#   C& 	=C3 &C0/C03C;:C;