
    Mh	              
       r   S SK r S SKrS SKJr   " S S5      r\R
                  R                  SSS/SS//5      S 5       r\R
                  R                  S	\\	S
/5      S 5       r
\R
                  R                  SS
S
/S
\ R                  /\S
/\\ R                  /\	S
/\	\ R                  //5      S 5       rg)    N)detect_console_encodingc                   P   ^  \ rS rSrSrSU 4S jjr\S 5       r\S 5       r	Sr
U =r$ )MockEncoding   z
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.
c                 .   > [         TU ]  5         Xl        g N)super__init__val)selfencoding	__class__s     V/var/www/html/env/lib/python3.13/site-packages/pandas/tests/io/formats/test_console.pyr
   MockEncoding.__init__   s        c                 8    U R                  U R                  5      $ r   )raise_or_returnr   )r   s    r   r   MockEncoding.encoding   s    ##DHH--r   c                 4    [        U [        5      (       a  U $ U er   )
isinstancestrr   s    r   r   MockEncoding.raise_or_return   s    c3JIr   r   )returnN)__name__
__module____qualname____firstlineno____doc__r
   propertyr   staticmethodr   __static_attributes____classcell__)r   s   @r   r   r      s5     . .  r   r   zempty,filledstdinstdoutc                     U R                  5        nUR                  SU 3[        S5      5        UR                  SU 3[        U5      5        [        5       U:X  d   e S S S 5        g ! , (       d  f       g = f)Nzsys. contextsetattrr   r   )monkeypatchemptyfilledr)   s       r   .test_detect_console_encoding_from_stdout_stdinr.      sa    
 
			'$ugR(89$vhf)=>&(F222 
		s   AA((
A6r   asciic                     U R                  5        nUR                  SS 5        UR                  S[        U5      5        [        5       S:X  d   e S S S 5        g ! , (       d  f       g = f)Nlocale.getpreferredencodingc                      g)Nfoo r4   r   r   <lambda>Atest_detect_console_encoding_fallback_to_locale.<locals>.<lambda>.   s    ur   
sys.stdoutr3   r(   )r+   r   r)   s      r   /test_detect_console_encoding_fallback_to_localer8   *   sQ     
			'5}El8&<=&(E111 
		s   ?A
A(z
std,localec                   ^ U R                  5        nUR                  SU4S j5        UR                  S[        U5      5        UR                  SS 5        [        5       S:X  d   e S S S 5        g ! , (       d  f       g = f)Nr1   c                  .   > [         R                  T 5      $ r   )r   r   )locales   r   r5   Btest_detect_console_encoding_fallback_to_default.<locals>.<lambda>D   s    <3O3OPV3Wr   r7   zsys.getdefaultencodingc                      g)NsysDefaultEncodingr4   r4   r   r   r5   r<   G   s    :Nr   r>   r(   )r+   stdr;   r)   s     ` r   0test_detect_console_encoding_fallback_to_defaultr@   3   sh     
			')+W	
 	l3&7802NO&(,@@@@ 
		s   AA11
A?)r;   pytestpandas._configr   r   markparametrizer.   AttributeErrorOSErrorr8   Errorr@   r4   r   r   <module>rH      s      2 . 7H*='?R)ST3 U3 ngw%GH2 I2 	'	&,,	!	&	'	&,,

A

Ar   