| Server IP : 209.209.40.120 / Your IP : 216.73.217.112 Web Server : Microsoft-IIS/10.0 System : Windows NT NEWWWW 10.0 build 17763 (Windows Server 2019) i586 User : NEWWWW$ ( 0) PHP Version : 8.3.30 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /Python312/Lib/site-packages/_pytest/__pycache__/ |
Upload File : |
�
��Hg[ � �� � d dl mZ d dlmZ d dlZd dlmZ d dlmZ d dlZd dl m
Z
d dl mZ d dl mZ d d l
mZ d d
lmZ d dlmZ d dlZdd�Ze dd
�� Zdd�Z ej. dd�� dd�� Z ej. dd�� dd�� Z ej. d�� dd�� Z ej. d�� dd�� Z ej. d�� dd�� Zy)� )�annotations)�contextmanagerN)� Generator)�Literal)�apply_warning_filters)�Config)�parse_warning_filter)�Session)�Item)�TerminalReporterc �( � | j dd� y )N�markersz�filterwarnings(warning): add a warning filter to the given test. see https://docs.pytest.org/en/stable/how-to/capture-warnings.html#pytest-mark-filterwarnings )�addinivalue_line)�configs �2C:\Python312\Lib\site-packages\_pytest/warnings.py�pytest_configurer s � �
���� i�� c # �� K � | j d� }| j j xs g }t j d�� 5 }|�J �t
j s6t j dt �� t j dt �� t ||� |�dn|j }|�E|j d�� D ]0 }|j D ] } t j t | d �
� � �! �2 d�� |D ]+ }
|j j! t# |
||d�� �� �- ddd� y# |D ]+ }
|j j! t# |
||d�� �� �- w xY w# 1 sw Y yxY w�w)
z�Context 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.
�filterwarningsT)�recordN�always)�category� )�nameF)�escape)�warning_message�nodeid�when�location)�kwargs)�getini�known_args_namespace�pythonwarnings�warnings�catch_warnings�sys�warnoptionsr �DeprecationWarning�PendingDeprecationWarningr r �iter_markers�argsr �pytest_warning_recorded�
call_historic�dict)r �ihookr �item�config_filters�cmdline_filters�logr �mark�argr s r �catch_warnings_for_itemr6 s{ � �� � �]�]�#3�4�N��1�1�@�@�F�B�O� � � �� -� ����������#�#�H�7I�J��#�#�H�7P�Q�
�n�o�>� �|���������)�)�/?�)�@�
V���9�9� V�C��+�+�-A�#�e�-T�U�V�
V� ��#&�
���-�-�;�;��(7�%�!�!%� � <� �
�1 � ��0 $'�
���-�-�;�;��(7�%�!�!%� � <� �
��1 � �s7 �AE2�B.E&�3D1�70E&�( E2�12E#�#E&�&E/�+E2c � � | j }t j t |� | j | j
| j | j � }| j �] ddl }|j | j � }|�)dj |j � � }|d|� �z
}|S d}|dz
}|d|� d�z
}|S |S # t $ r Y |S w xY w) z.Convert a warnings.WarningMessage to a string.Nr �
z
Object allocated at:
zPhttps://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warningszDEnable tracemalloc to get traceback where the object was allocated.
zSee z for more info.)�messager$ �
formatwarning�strr �filename�lineno�line�source�tracemalloc�get_object_traceback�join�format�ImportError)r �warn_msg�msgr@ �tb�formatted_tb�urls r �warning_record_to_strrJ M s� � ��&�&�H�
�
�
��H�
�� � �� � ��������C� ���)� 3�� �1�1�/�2H�2H�I�B��~�#�y�y�����5�� �1�,��@�@�� �J� i���^�^����c�U�/�2�2���J�3�J�� � �� �J� �s �$C � C�CT)�wrapper�tryfirstc # � K � t | j | j d| �� 5 d ��cd d d � S # 1 sw Y y xY w�w)N�runtest�r r/ r r0 )r6 r r/ )r0 s r �pytest_runtest_protocolrP k s8 � �� � ��{�{�$�*�*�9�4�
� � �� � �s �$A �4�
A �=�A c # � K � | j }t ||j dd �� 5 d ��cd d d � S # 1 sw Y y xY w�w)N�collectrO �r r6 �hook��sessionr s r �pytest_collectionrW s s= � �� �
�^�^�F� ��V�[�[�y�t�
� � �� � �� �&A�6�
A�?�A)rK c # � K � | j }t ||j dd �� 5 d ��cd d d � S # 1 sw Y y xY w�w�Nr rO rS )�terminalreporterr s r �pytest_terminal_summaryr\ | sA � �� � �
$�
$�F� ��V�[�[�x�d�
� � �� � �rX c # � K � | j }t ||j dd �� 5 d ��cd d d � S # 1 sw Y y xY w�wrZ rS rU s r �pytest_sessionfinishr^ � s= � �� �
�^�^�F� ��V�[�[�x�d�
� � �� � �rX c # �p K � t | | j dd �� 5 d ��cd d d � S # 1 sw Y y xY w�wrZ )r6 rT )�early_configs r �pytest_load_initial_conftestsra � s8 � �� �
!��<�#4�#4�8�$�
� � �� � �s �6�*�
6�3�6)r r �return�None)r r r z'Literal['config', 'collect', 'runtest']r0 zItem | Nonerb �Generator[None])r zwarnings.WarningMessagerb r; )r0 r rb �Generator[None, object, object])rV r
rb re )r[ r rb rd )rV r
rb rd )r` r rb rd )�
__future__r �
contextlibr r&