
    M/PhB                        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n# e$ r dZY nw xY w e j        e          ZdZ	  eej                            dd                    Zeej        j        _        n# e$ r Y nw xY were                    d           ne                    d           d	 Zd
 Zd Z ej                    d             Z ej                    d             Zd ZdS )    N)PYTHON_IMPL_WASMaggTFSM_TEST_COPY_ON_WRITEzCopy on Write Enabled!zCopy on Write disabledc                 &   |                      ddd           |                      ddd           |                      ddd           |                      d	dd
           |                      ddd           |                      ddd           d S )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    T/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/statsmodels/conftest.pypytest_addoptionr   !   s    
]<+  - - -
]</  1 1 1
&|2  4 4 4
(@  B B B
^L,  . . .
^L0  2 2 2 2 2    c                    d| j         v r.| j                            d          rt          j        d           d| j         vr.| j                            d          rt          j        d           d| j         v r.| j                            d          rt          j        d           d	| j         v r.| j                            d
          rt          j        d           d	| j         v rt
          st          j        d           d| j         v r.| j                            d          rt          j        d           d| j         vr0| j                            d          rt          j        d           d S d S d S )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   sp   4;#8#8#G#G1222T]""t{'<'<]'K'K"1222DM!!dk&;&;<M&N&N!5666t}$$K!!"566 %7888t}$$_$?@@@$-DK$9$9.$I$I2333dm##(=(=n(M(M#233333 $###r   c                     	 dd l } |j        d           	 ddlm}  |             d S # t          $ r Y d S w xY w# t          $ r Y d S w xY w)Nr   r   )register_matplotlib_converters)r   usepandas.plottingr#   ImportError)r   r   r#   s      r   pytest_configurer'   H   s    	
u	FFFFFF**,,,,, 	 	 	DD	   s#   : ) 
7: 7: 
AAc               #   d   K   	 ddl fd} n# t          $ r d } Y nw xY w| V   |              dS )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                             d           d S )Nall)pyplotclose)r   s   r   r,   zclose_figures.<locals>.closes   s     ##E*****r   c                      d S )N r.   r   r   r,   zclose_figures.<locals>.closew   s    Dr   )matplotlib.pyplotr&   )r,   r   s    @r   close_figuresr0   U   s      6    	+ 	+ 	+ 	+ 	+ 	+    	 	 	 	 	 KKK	EGGGGGs   	 c               #      K   t           j                                        } t           j                            d           dV  t           j                            |            dS )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   ~   sT       I!!EINN1	EEEIr   c                     t           ru|D ]p}d|j        v re|                    d          }|rNt          |j                  }d|d<   t          j        j        di |}|                    |           ||j        d<   qd S d S )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      
	6 
	6D$-''..w77 6 "&dk!2!2J+0Jx(%{0>>:>>HOOH----5DM'*
	6 
	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 6 6 6 6 6JN5OO   OOO 
	8	$	$	
$rz~~5u==
>
>C$'BJO!! 	 	 	D	  .
OO,----
OO,---2 2 24 4 40
 
 
 % % %P   4    s   3 ==5B	 	BB