관리-도구
편집 파일: test_gc.cpython-38.pyc
U �gk � @ sN d dl Z d dlZd dlZddlmZ ddlmZ ejs:t�G dd� de�Z dS )� N� )�TestCase)�fails_leakcheckc @ s0 e Zd Zdd� Zdd� Zdd� Zedd� �Zd S ) �GCTestsc C sb t �t�tj��� �}t�� |� d k rBdd l}td|� |� �� | � |� � | �tjtj� d S )Nr zO IS NOT NONE.) �weakref�ref�greenlet� getcurrent�switch�gc�collect�sys�print�getrefcount�assertIsNone�assertFalse�garbage)�self�or � r �F/opt/hc_python/lib64/python3.8/site-packages/greenlet/tests/test_gc.py�test_dead_circular_ref s zGCTests.test_dead_circular_refc C sP G dd� dt j �}|� }||_t�|�}t�� | �|� � | �tjtj� d S )Nc @ s e Zd ZdZdS )z9GCTests.test_circular_greenlet.<locals>.circular_greenletN)�__name__� __module__�__qualname__r r r r r �circular_greenlet s r ) r r r r r r r r r )r r r r r r �test_circular_greenlet s zGCTests.test_circular_greenletc C sJ G dd� dt j �}|� }t�|�}t�� | �|� � | �tjtj� d S )Nc @ s e Zd Zdd� Zdd� ZdS )z4GCTests.test_inactive_ref.<locals>.inactive_greenletc S s t j j| | jd� d S )N)�run)r �__init__r �r r r r r $ s z=GCTests.test_inactive_ref.<locals>.inactive_greenlet.__init__c S s d S �Nr r r r r r '