관리-도구
편집 파일: test_leaks.cpython-38.pyc
U �g9D � @ s� d Z ddlmZmZmZ ddlZddlZddlZddlZddl Z ddl Z ddlmZ ddl mZ ddl mZ ddl mZ e js�t�G d d � d e�ZG dd� de�Zed kr�ed��� dS )z) Testing scenarios that may have leaked. � )�print_function�absolute_import�divisionN� )�TestCase)�fails_leakcheck)�ignores_leakcheck)�RUNNING_ON_MANYLINUXc @ s6 e Zd Ze� Zdd� Zdd� Zdd� Zedd� �Z d S ) �HasFinalizerTracksInstancesc C s t �|�| _| j�t| �� d S �N)�sys�intern�msg�EXTANT_INSTANCES�add�id)�selfr � r �I/opt/hc_python/lib64/python3.8/site-packages/greenlet/tests/test_leaks.py�__init__ s z$HasFinalizerTracksInstances.__init__c C s | j �t| �� d S r )r �remover �r r r r �__del__ s z#HasFinalizerTracksInstances.__del__c C s dt | �| jf S )Nz(<HasFinalizerTracksInstances at 0x%x %r>)r r r r r r �__repr__ s �z$HasFinalizerTracksInstances.__repr__c C s | j �� d S r )r �clear)�clsr r r �reset$ s z!HasFinalizerTracksInstances.resetN) �__name__� __module__�__qualname__�setr r r r �classmethodr r r r r r s r c @ s� e Zd Zdd� Zdd� Zedd� �Zdd� Zd d � Zdd� Z d'dd�Z dd� Zdd� Ze dd� �Ze dd� �Ze dd� �ZdZdd� Zedd� �Zd(d d!�Zed"d#� �Zed$d%� �Zd&S ))� TestLeaksc C sJ d}t �|�}t�dd� �}td�D ]}|j|� q$| �t �|�|� d S )N)�a�b�cc W s t �� jj| � S r ��greenlet� getcurrent�parent�switch)�argsr r r �<lambda>0 � z)TestLeaks.test_arg_refs.<locals>.<lambda>�d )r �getrefcountr'