
    yIf,              	      H   U d Z ddlm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mZ ddl	Z	ddl
mZ ddlZddlmZ ddlmZ dd	lmZ dd
lmZ ddlZej        j        ZdEdZ G d dej                  Zej        Zded<   dFdZdFdZdFdZdGdHdZdIdZ d dd!dJd(Z!dKd*Z"d+  e#d,          D             Z$e$%                     e&d-          d. e&d/          d0 e&d1          d2i           dLd5Z'ej(         G d6 d7                      Z)d8 Z*d9 Z+d: Z,dMd=Z-dNd?Z.dOdAZ/dPdDZ0dS )Qz"Python version compatibility code.    )annotationsN)	Parameter)	signature)Path)Any)Callable)Final)NoReturnpathstr | os.PathLike[str]returnLEGACY_PATHc                     t          |           S )zBInternal wrapper to prepare lazy proxies for legacy_path instances)r   )r   s    B/var/www/piapp/venv/lib/python3.11/site-packages/_pytest/compat.pylegacy_pathr       s    t    c                      e Zd ZdZdS )
NotSetTyper   N)__name__
__module____qualname__token r   r   r   r   (   s        EEEr   r   r	   NOTSETfuncobjectboolc                N    t          j        |           }|ot          |            S N)inspectisgeneratorfunctioniscoroutinefunction)r   genfuncs     r   is_generatorr$   .   s)    )$//G4.t4444r   c                L    t          j        |           pt          | dd          S )a{  Return True if func is a coroutine function (a function defined with async
    def syntax, and doesn't contain yield), or a function decorated with
    @asyncio.coroutine.

    Note: copied and modified from Python 3.5's builtin couroutines.py to avoid
    importing asyncio directly, which in turns also initializes the "logging"
    module as a side-effect (see issue #8).
    _is_coroutineF)r    r"   getattrr   s    r   r"   r"   3   s&     &t,,Uou0U0UUr   c                H    t          |           pt          j        |           S )zZReturn True if the given function seems to be an async function or
    an async generator.)r"   r    isasyncgenfunctionr(   s    r   is_async_functionr+   ?   s"     t$$H(B4(H(HHr   curdirstr | os.PathLike[str] | Nonestrc                    t          |           } t          t          j        |                     }| j        j        }|0	 |                    |          }d||dz   fz  S # t          $ r Y nw xY wd||dz   fz  S )Nz%s:%d   )get_real_funcr   r    getfile__code__co_firstlinenorelative_to
ValueError)functionr,   fnlinenorelfns        r   getlocationr;   E   s    X&&H	goh''	(	(B-F	1NN6**E eVaZ000  	 	 	D	 b&1*%%%s    A 
A,+A,intc                P   t          | dd          }|sdS t          t          j                            d          dt	                                t          t          j                            d          dt	                                t          fd|D                       S )z>Return number of arguments used up by mock arguments (if any).	patchingsNr   mockDEFAULTzunittest.mockc                F    g | ]}|j         s|j        u s	|j        u |S r   )attribute_namenew).0pmock_sentinelut_mock_sentinels     r   
<listcomp>z'num_mock_patch_args.<locals>.<listcomp>]   sM     	
 	
 	
#	
 -''154D+D+D  ,E+D+Dr   )r'   sysmodulesgetr   len)r7   r>   rF   rG   s     @@r   num_mock_patch_argsrM   S   s    +t44I qCKOOF33YIIMs{??FHHUU	
 	
 	
 	
 	
	
 	
 	
  r    )nameclsr7   Callable[..., object]rO   rP   type | Nonetuple[str, ...]c                  	 t          |           j        }n7# t          t          f$ r#}ddlm}  |d| d| d           Y d}~nd}~ww xY wt          d |                                D                       }|s| j        }|r4t          t          j        ||d	          t                    s
|d
d         }t          | d          r|t          |           d         }|S )a   Return the names of a function's mandatory arguments.

    Should return the names of all function arguments that:
    * Aren't bound to an instance or type as in instance or class methods.
    * Don't have default values.
    * Aren't bound with functools.partial.
    * Aren't replaced with mocks.

    The cls arguments indicate that the function should be treated as a bound
    method even though it's not unless the function is a static method.

    The name parameter should be the original name in which the function was collected.
    r   )failz!Could not determine arguments of z: F)pytraceNc              3     K   | ]D}|j         t          j        u s|j         t          j        u r|j        t          j        u ;|j        V  Ed S r   kindr   POSITIONAL_OR_KEYWORDKEYWORD_ONLYdefaultemptyrO   rD   rE   s     r   	<genexpr>z"getfuncargnames.<locals>.<genexpr>   sa        Fi555v///I(( 	
 )((( r   )r\   r0   __wrapped__)r   
parametersr6   	TypeError_pytest.outcomesrU   tuplevaluesr   
isinstancer    getattr_staticstaticmethodhasattrrM   )r7   rO   rP   ra   erU   	arg_namess          r   getfuncargnamesrl   f   sW   8
x((3

	" 
 
 
))))))AAAaAA	
 	
 	
 	
 	
 	
 	
 	
 	

   ""$$    I  !  	" "3d;;;\
 
	" abbM	x'' ?1(;;==>	s    AAACallable[..., Any]c                |    t          d t          |           j                                        D                       S )Nc              3     K   | ]=}|j         t          j        t          j        fv r|j        t          j        u4|j        V  >d S r   rX   r^   s     r   r_   z(get_default_arg_names.<locals>.<genexpr>   sY        6i5y7MNNNIY_,, 	
 -,,,	 r   )rd   r   ra   re   )r7   s    r   get_default_arg_namesrp      sI       8$$/6688     r   c                @    i | ]}|t          d d          v|d|dS )       z\x02x)range)rD   is     r   
<dictcomp>rw      s;     ( ( (AU2s^^,C,CA}Q}}},C,C,Cr      	z\tz\r
z\nvalbytes | strc                    t          | t                    r|                     dd          }n(|                     d                              d          }|                    t
                    S )a	  If val is pure ASCII, return it as an str, otherwise, escape
    bytes objects into a sequence of escaped bytes:

    b'\xc3\xb4\xc5\xd6' -> r'\xc3\xb4\xc5\xd6'

    and escapes strings into a sequence of escaped unicode ids, e.g.:

    r'4\nV\U00043efa\x0eMXWB\x1e\u3028\u15fd\xcd\U0007d944'

    Note:
       The obvious "v.decode('unicode-escape')" will return
       valid UTF-8 unicode if it finds them in bytes, but we
       want to return escaped bytes for any byte, even if they match
       a UTF-8 string.
    asciibackslashreplaceunicode_escape)rf   bytesdecodeencode	translate$_non_printable_ascii_translate_table)r|   rets     r   ascii_escapedr      s_      #u ;jj"455jj)**11'::===>>>r   c                      e Zd ZU dZded<   dS )_PytestWrappera%  Dummy wrapper around a function object for internal use only.

    Used to correctly unwrap the underlying function object when we are
    creating fixtures, because we wrap the function object ourselves with a
    decorator to issue warnings when the fixture function is called directly.
    r   objN)r   r   r   __doc____annotations__r   r   r   r   r      s%           HHHHHr   r   c                V   | }t          d          D ]H}t          | dd          }t          |t                    r	|j        }  nEt          | dd          }| n0|} Iddlm} t          d ||           d ||                      t          | t          j	                  r| j
        } | S )	zjGet the real function object of the (possibly) wrapped object by
    functools.wraps or functools.partial.d   __pytest_wrapped__Nr`   r   )safereprz could not find real function of z
stopped at )ru   r'   rf   r   r   _pytest._io.safereprr   r6   	functoolspartialr   )r   	start_objrv   new_objr   s        r   r1   r1      s     I3ZZ 
 
 #3T::g~.. 	+CE#}d33?E111111`xx	/B/B``QYQYZ]Q^Q^``
 
 	
 #y()) hJr   c                    	 t          | d          }t          |           } n# t          $ r | cY S w xY w|r9t          | d          r)t          | j                  r|                     |          } | S )zAttempt to obtain the real function object that might be wrapping
    ``obj``, while at the same time returning a bound method to ``holder`` if
    the original object was a bound method.__func____get__)ri   r1   	Exceptioncallabler   )r   holder	is_methods      r   get_real_methodr      s    C,,	C     


 "WS),, "#+1F1F "kk&!!Js   " 11c                6    	 | j         S # t          $ r | cY S w xY wr   )r   AttributeErrorr(   s    r   	getimfuncr   
  s3    }   s   	 r   r\   c                L    ddl m} 	 t          | ||          S # |$ r |cY S w xY w)aR  Like getattr but return default upon any Exception or any OutcomeException.

    Attribute access can potentially fail for 'evil' Python objects.
    See issue #214.
    It catches OutcomeException because of #2490 (issue #580), new outcomes
    are derived from BaseException instead of Exception (for more details
    check #2707).
    r   )TEST_OUTCOME)rc   r   r'   )r   rO   r\   r   s       r   safe_getattrr     sQ     .-----vtW---   s    ##r   c                N    	 t          j        |           S # t          $ r Y dS w xY w)z0Ignore any exception via isinstance on Python 3.F)r    isclassr   )r   s    r   safe_isclassr   "  s9    s###   uus    
$$
int | Nonec                     t           j        dk    st           j        dk    rdS d} t          j                    }|| k    r|ndS )zReturn the current process's real user id or None if it could not be
    determined.

    :return: The user id or None if it could not be determined.
    win32
emscriptenN)rI   platformosgetuid)ERRORuids     r   get_user_idr   *  sH     |w#,,">"> t ikkUllss,r   valuer
   c                H    J d|  dt          |           j         d            )NFzUnhandled value: z ())typer   )r   s    r   assert_neverr   ^  s-    FFeFFtE{{/CFFFFFFr   )r   r   r   r   )r   r   r   r   r   )r,   r-   r   r.   )r   r<   )r7   rQ   rO   r.   rP   rR   r   rS   )r7   rm   r   rS   )r|   r}   r   r.   )r   r   rO   r.   r\   r   r   r   )r   r   r   r   )r   r   )r   r
   r   r
   )1r   
__future__r   dataclassesenumr   r    r   r   r   pathlibr   rI   typingr   r   r	   r
   pyr   localr   r   Enumr   r   r   r   r$   r"   r+   r;   rM   rl   rp   ru   r   updateordr   	dataclassr   r1   r   r   r   r   r   r   r   r   r   <module>r      s7   ( ( ( " " " " " "                       				       



                         				 gn                   5 5 5 5
	V 	V 	V 	VI I I I& & & & &   , 	A A A A A AH	 	 	 	( (#eCjj( ( ( $ % + +SYYss4yy%TE:  
? ? ? ?.          6       "   - - - -hG G G G G Gr   