
    Eg	              
       h   d dl Z d dlZd dlmZ  G d d          Zej                            dddgddgg          d             Zej                            d	ee	d
g          d             Z
ej                            dd
d
gd
e j        ged
gee j        ge	d
ge	e j        gg          d             ZdS )    N)detect_console_encodingc                   P     e Zd ZdZd fdZed             Zed             Z xZ	S )MockEncodingz
    Used to add a side effect when accessing the 'encoding' property. If the
    side effect is a str in nature, the value will be returned. Otherwise, the
    side effect should be an exception that will be raised.
    returnNc                 V    t                                                       || _        d S N)super__init__val)selfencoding	__class__s     Y/var/www/sysmax/venv/lib/python3.11/site-packages/pandas/tests/io/formats/test_console.pyr
   zMockEncoding.__init__   s$        c                 6    |                      | j                  S r   )raise_or_returnr   )r   s    r   r   zMockEncoding.encoding   s    ##DH---r   c                 4    t          | t                    r| S | r   )
isinstancestr)r   s    r   r   zMockEncoding.raise_or_return   s    c3 	JIr   )r   N)
__name__
__module____qualname____doc__r
   propertyr   staticmethodr   __classcell__)r   s   @r   r   r      s}               . . X.   \    r   r   zempty,filledstdinstdoutc                 "   |                                  5 }|                    d| t          d                     |                    d| t          |                     t                      |k    sJ 	 d d d            d S # 1 swxY w Y   d S )Nzsys. contextsetattrr   r   )monkeypatchemptyfilledr"   s       r   .test_detect_console_encoding_from_stdout_stdinr'      s    
 
				 3'uR(8(8999vf)=)=>>>&((F222223 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3s   A!BBBr   asciic                     |                                  5 }|                    dd            |                    dt          |                     t                      dk    sJ 	 d d d            d S # 1 swxY w Y   d S )Nlocale.getpreferredencodingc                      dS )Nfoo r-   r   r   <lambda>zAtest_detect_console_encoding_fallback_to_locale.<locals>.<lambda>.   s    u r   
sys.stdoutr,   r!   )r$   r   r"   s      r   /test_detect_console_encoding_fallback_to_localer0   *   s     
				 2'5}}EEEl8&<&<===&((E111112 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2s   AA22A69A6z
std,localec                 2   |                                  5 }|                    dfd           |                    dt          |                     |                    dd            t                      dk    sJ 	 d d d            d S # 1 swxY w Y   d S )Nr*   c                  8    t                                          S r   )r   r   )locales   r   r.   zBtest_detect_console_encoding_fallback_to_default.<locals>.<lambda>D   s    <3O3OPV3W3W r   r/   zsys.getdefaultencodingc                      dS )NsysDefaultEncodingr-   r-   r   r   r.   zBtest_detect_console_encoding_fallback_to_default.<locals>.<lambda>G   s    :N r   r5   r!   )r$   stdr3   r"   s     ` r   0test_detect_console_encoding_fallback_to_defaultr7   3   s    
				 A')+W+W+W+W	
 	
 	
 	l3&7&788802N2NOOO&((,@@@@@@A A A A A A A A A A A A A A A A A As   A(BBB)r3   pytestpandas._configr   r   markparametrizer'   AttributeErrorOSErrorr0   Errorr7   r-   r   r   <module>r?      sB     2 2 2 2 2 2       . 7H*='?R)STT3 3 UT3 ngw%GHH2 2 IH2 	'	&,	!	&	'	&,
 

A 
A
 

A 
A 
Ar   