| Server IP : 127.0.0.1 / Your IP : 216.73.216.109 Web Server : Apache/2.4.54 (Win64) OpenSSL/1.1.1q PHP/8.1.10 System : Windows NT DESKTOP-E5T4RUN 10.0 build 19045 (Windows 10) AMD64 User : SERVERWEB ( 0) PHP Version : 8.1.10 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/cygwin64/lib/python3.9/site-packages/_pytest/__pycache__/ |
Upload File : |
a
05d� � @ s� 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 er�d dlmZ edd
�dd�Zeedee ed d�dd��Zejed�dd�Zejddd�eed d�dd��Zejddd�eed d�dd��Zejdd �eed d!�d"d#��Zejdd �eed d�d$d%��Zejdd �d&ed d'�d(d)��ZdS )*� N)�contextmanager)� Generator)�Optional)�
TYPE_CHECKING)�apply_warning_filters)�Config)�parse_warning_filter)�Session)�Item)�TerminalReporter)�Literal)�config�returnc C s | � dd� d S )NZmarkersz�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 )Zaddinivalue_line)r
� r �4/usr/lib/python3.9/site-packages/_pytest/warnings.py�pytest_configure s �r z'Literal['config', 'collect', 'runtest'])NNN)r
�when�itemr c c s� | � d�}| jjpg }tjdd���}|dus0J �tjsRtjdtd� tjdt d� t
||� |du rhdn|j}|dur�|jdd�D ]"}|j
D ]} tjt| d d
�� q�q�dV |D ]}
|jjt|
||dd�d� q�W d � n1 s�0 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)ZgetiniZknown_args_namespaceZpythonwarnings�warnings�catch_warnings�sys�warnoptionsr �DeprecationWarning�PendingDeprecationWarningr r Ziter_markers�argsr Zpytest_warning_recordedZ
call_historic�dict)r
�ihookr r Zconfig_filtersZcmdline_filters�logr Zmark�argr r r r �catch_warnings_for_item s.
��r* )r r c C s� | j }t�t|�| j| j| j| j�}| jdur�zddl }W n t
yL Y nP0 |�| j�}|dur�d�|�
� �}|d|� �7 }nd}|d7 }|d|� d�7 }|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 �
formatwarning�strr �filename�lineno�line�source�tracemalloc�ImportError�get_object_traceback�join�format)r Zwarn_msg�msgr3 �tbZformatted_tb�urlr r r �warning_record_to_strJ s* �
r; T)�hookwrapperZtryfirst)r r c c s>