
    *g6                         d dl Z d dlZd dlZd dlmc mZ d dlZej                  d        Z	ej                  d        Z
d Zd Zd Zd Zd Z ej                   d	      d
        Zd Zy)    Nc                  L    t        j                  d      } t        | dd        | S )Npandas_dummy_backendplotc                       y)N
used_dummy )argskwargss     l/var/www/html/articles-backend/trend/venv/lib/python3.12/site-packages/pandas/tests/plotting/test_backend.py<lambda>zdummy_backend.<locals>.<lambda>   s        )types
ModuleTypesetattr)dbs    r   dummy_backendr      s%    			0	1BB<=Ir   c               #   j   K   t        j                  dd      5  d ddd       y# 1 sw Y   yxY ww)z*Restore the plotting backend to matplotlibplotting.backend
matplotlibN)pandasoption_contextr   r   r   restore_backendr      s0      
		1<	@   s   3'	303c                      d} t        j                  t        |       5  t        j                  dd       d d d        t        j
                  j                  j                  dk(  sJ y # 1 sw Y   3xY w)Nz9Could not find plotting backend 'not_an_existing_module'.matchr   not_an_existing_moduler   )pytestraises
ValueErrorr   
set_optionoptionsplottingbackendmsgs    r   test_backend_is_not_moduler&      s`    
EC	z	- H,.FGH >>""**l:::H Hs   A''A0c                     | j                  t        j                  d|       t        j                  dd       t        j
                  d      dk(  sJ t        j                  j                  j                  d      |u sJ y )Nr   r   )	setitemsysmodulesr   r    
get_optionr"   _core_get_plot_backend)monkeypatchr   r   s      r   test_backend_is_correctr/   !   sl    %;]K
(*@A/04JJJJ//0FG=XXr   c                     | j                  t        j                  d|       t        j                  g d      }t        j
                  d      dk(  sJ |j                  d      dk(  sJ y )Nr            r   r   )r#   r   )r(   r)   r*   r   	DataFramer+   r   r.   r   r   dfs       r   $test_backend_can_be_set_in_plot_callr8   +   s]    %;]K			)	$B/0L@@@77172lBBBr   c                    |j                  |       |j                  t        j                  d|       |dz  }|j	                          |dz  j                  d       t        j                  j                  j                  d      |u sJ t        j                  dd      5  t        j                  j                  j                         |u sJ 	 d d d        y # 1 sw Y   y xY w)Nr   zmy_backend-0.0.0.dist-infozentry_points.txts@   [pandas_plotting_backends]
my_ep_backend = pandas_dummy_backend
my_ep_backendr   )syspath_prependr(   r)   r*   mkdirwrite_bytesr   r"   r,   r-   r   )r   tmp_pathr.   r   	dist_infos        r   test_register_entrypointr@   3   s    )%;]K77IOO ##00M ??  22?C}TTT			1?	C J$$668MIIIJ J Js   -CCc                    t        j                  d      }| j                  t        j                  d|       t
        j                  j                  j                  dk(  sJ t        j                  t        d      5  t        j                  dd       d d d        t
        j                  j                  j                  dk(  sJ y # 1 sw Y   3xY w)Npandas_plot_backendr   z6Could not find plotting backend 'pandas_plot_backend'.r   r   )r   r   r(   r)   r*   r   r!   r"   r#   r   r   r   r    )r.   modules     r   (test_setting_backend_without_plot_raisesrD   E   s    34F%:FC>>""**l:::	R
 E 	,.CDE
 >>""**l:::E Es   ;CCr   c                      d} t        j                  t        |       5  t        j                  j
                  j                  d       d d d        y # 1 sw Y   y xY w)NzVmatplotlib is required for plotting when the default backend "matplotlib" is selected.r   r   )r   r   ImportErrorr   r"   r,   r-   r$   s    r   test_no_matplotlib_okrG   S   sI    	  
{#	. >//=> > >s   *AAc                     | j                  t        j                  d|       t        j                  dd       t        j
                  dg di      }|j                  d       y )Nr   r   Ar1   znot a real kind)kind)r(   r)   r*   r   r    r5   r   r6   s       r   test_extra_kinds_okrK   ]   sO    %;]K
(*@A			3	*	+BGG"G#r   )r)   r   r   pandas.util._test_decoratorsutil_test_decoratorstdr   fixturer   r   r&   r/   r8   r@   rD   skip_if_installedrG   rK   r   r   r   <module>rR      s    
   ) )     ;CJ$; l#> $>$r   