관리-도구
편집 파일: warnings.cpython-311.pyc
� �܋f� � � � d dl Z d dlZd dlmZ d dlmZ d dlmZ d dlmZ d dlZd dl m Z d dl mZ d dl mZ d d l mZ d d lmZ d dlmZ erd dlmZ d eddfd�Zed edddee ded fd�� � Zdej defd�Z ej dd�� � deded fd�� � Z ej dd�� � deded fd�� � Z ej d�� � deded fd�� � Z ej d�� � deded fd�� � Z ej d�� � d d!ded fd"�� � ZdS )#� N)�contextmanager)� Generator)�Optional)� TYPE_CHECKING)�apply_warning_filters)�Config)�parse_warning_filter)�Session)�Item)�TerminalReporter)�Literal�config�returnc �2 � | � dd� � d S )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)r s �a/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/_pytest/warnings.py�pytest_configurer s- � � ���� i�� � � � � �whenz'Literal['config', 'collect', 'runtest']�item)NNNc # �^ K � | � d� � }| j j pg }t j d�� � 5 }|�J �t j s6t j dt �� � t j dt �� � t ||� � |�dn|j }|�@|� d�� � D ])}|j D ]} t j t | d � � � � � �*dV � |D ].} |j � t# | ||d�� � �� � �/ ddd� � dS # 1 swxY w Y dS ) 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�nodeidr �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 r �config_filters�cmdline_filters�logr! �mark�argr s r �catch_warnings_for_itemr8 s� � � � � �]�]�#3�4�4�N��1�@�F�B�O� � �� -� -� -� �������� R��#�H�7I�J�J�J�J��#�H�7P�Q�Q�Q�Q��n�o�>�>�>� �|���������)�)�/?�)�@�@� V� V���9� V� V�C��+�-A�#�e�-T�-T�-T�U�U�U�V� ����"� � �O��)�7�7��$3�!��!� � � � 8� � � � � �)� � � � � � � � � � � ���� � � � � � s �CD"�"D&�)D&r c �x � | j }t j t |� � | j | j | j | j � � }| j �r ddl }|� | j � � }|�0d� |� � � � � }|d|� �z }n!d}|dz }|d|� d�z }n# t $ r Y nw xY w|S ) 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'