
    ziJ                       d dl mZ d dlm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mZ d dlmZ d dlmZ d dlZeddd/d            Zd0dZ ej        dd          d1d"            Z ej        dd          d2d%            Z ej        d&          d3d)            Z ej        d&          d4d*            Z ej        d&          d5d,            Zd6d.Z dS )7    )annotations)	Generator)contextmanager)	ExitStackN)Literal)apply_warning_filters)Config)parse_warning_filter)Session)Item)TerminalReporter)tracemalloc_messageTrecordconfigr	   when'Literal['config', 'collect', 'runtest']itemItem | Noner   boolreturnGenerator[None]c             #    K   |                      d          }| j        j        pg }t          j        |          5 }t
          j        s6t          j        dt                     t          j        dt                     t          j        dt          j                   t          ||           |dn|j        }|@|                    d          D ])}	|	j        D ]}
t          j        t!          |
d	
             *	 dV  |r5|J |D ].}|j                            t'          |||d                     /n=# |r5|J |D ]/}|j                            t'          |||d                     /w w xY wddd           dS # 1 swxY w Y   dS )zContext manager that catches warnings generated in the contained execution block.

    ``item`` can be None if we are not in the context of an item execution.

    Each warning captured triggers the ``pytest_warning_recorded`` hook.
    filterwarningsr   always)categoryerrorN )nameF)escape)warning_messagenodeidr   location)kwargs)getiniknown_args_namespacepythonwarningswarningscatch_warningssyswarnoptionsr   DeprecationWarningPendingDeprecationWarningpytestPytestRemovedIn9Warningr   r"   iter_markersargsr
   pytest_warning_recordedcall_historicdict)r   ihookr   r   r   config_filterscmdline_filterslogr"   markargr!   s               S/root/projects/openclaw-proxy/venv/lib/python3.11/site-packages/_pytest/warnings.pycatch_warnings_for_itemr<      sZ      ]]#344N1@FBO		 	/	/	/  3 	R#H7IJJJJ#H7PQQQQ&2PQQQQno>>> |))/?)@@ V V9 V VC+-A#e-T-T-TUUUV	EEE '*  O1??#,;#)!%%)	      @      '*  O1??#,;#)!%%)	      @    1                                   s*   C F<D8 8F8:E22FF	Fr!   warnings.WarningMessagestrc                    t          j        t          | j                  | j        | j        | j        | j                  t          | j	                  z   S )z.Convert a warnings.WarningMessage to a string.)
r(   formatwarningr>   messager   filenamelinenoliner   source)r!   s    r;   warning_record_to_strrF   I   sR    !O#$$    	O2334 4    )wrappertryfirstr   Generator[None, object, object]c              #  |   K   t          | j        | j        d|           5  d V cd d d            S # 1 swxY w Y   d S )Nruntestr   r5   r   r   )r<   r   r5   )r   s    r;   pytest_runtest_protocolrN   T   s      	 {$*94
 
 
                    s   155sessionr   c              #     K   | j         }t          ||j        dd           5  d V cd d d            S # 1 swxY w Y   d S )NcollectrM   r   r<   hookrO   r   s     r;   pytest_collectionrU   \   s      ^F	 V[yt
 
 
                       377)rH   terminalreporterr   c              #     K   | j         }t          ||j        dd           5  d V cd d d            S # 1 swxY w Y   d S Nr   rM   rR   )rW   r   s     r;   pytest_terminal_summaryrZ   e   s       $F	 V[xd
 
 
                    rV   c              #     K   | j         }t          ||j        dd           5  d V cd d d            S # 1 swxY w Y   d S rY   rR   rT   s     r;   pytest_sessionfinishr\   p   s      ^F	 V[xd
 
 
                    rV   early_configc              #  r   K   t          | | j        dd           5  d V cd d d            S # 1 swxY w Y   d S rY   )r<   rS   )r]   s    r;   pytest_load_initial_conftestsr_   y   s       
!<#48$
 
 
                    s   ,00Nonec           
     0   t                      5 }|                    t          | | j        dd d                     |                     dd           |                     |                                j                   d d d            d S # 1 swxY w Y   d S )Nr   F)r   r5   r   r   r   markerszfilterwarnings(warning): add a warning filter to the given test. see https://docs.pytest.org/en/stable/how-to/capture-warnings.html#pytest-mark-filterwarnings )r   enter_contextr<   rS   addinivalue_lineadd_cleanuppop_allclose)r   stacks     r;   pytest_configureri      s    	 2#k
 
 
 
	
 	
 	
 	m	
 	
 	

 	5==??0111'2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2s   A/BBB)
r   r	   r   r   r   r   r   r   r   r   )r!   r=   r   r>   )r   r   r   rJ   )rO   r   r   rJ   )rW   r   r   r   )rO   r   r   r   )r]   r	   r   r   )r   r	   r   r`   )!
__future__r   collections.abcr   
contextlibr   r   r*   typingr   r(   _pytest.configr   r	   r
   _pytest.mainr   _pytest.nodesr   _pytest.terminalr   _pytest.tracemallocr   r.   r<   rF   hookimplrN   rU   rZ   r\   r_   ri    rG   r;   <module>ru      sN   " " " " " " % % % % % % % % % % % %             



        0 0 0 0 0 0 ! ! ! ! ! ! / / / / / /                   - - - - - - 3 3 3 3 3 3   0 0 0 0 0 0f4 4 4 4 ---   .- ---   .-            2 2 2 2 2 2rG   