File: //usr/local/lib/python3.10/dist-packages/greenlet/tests/__pycache__/leakcheck.cpython-310.pyc
o
���g�. � @ s d dl mZ d dlZd dlZd dlZd dlmZ d dlZd dlZej �
d�Zej �
d�p-eZej �
d�Z
ep7e
Zej �
d�ZepEej �
d�Zej �
d �Zej �
d
�Zdd� Zd
d� ZG dd� de�Zeed�rvG dd� de�Ze� e_eZndd� ZG dd� de�ZG dd� de�Zdd� ZdS )� )�print_functionN)�wraps�GITHUB_ACTIONS�TRAVIS�APPVEYOR�GREENLET_MANYLINUX�GREENLET_SKIP_LEAKCHECKS� GREENLET_SKIP_FAILING_LEAKCHECKS� GREENLET_ONLY_FAILING_LEAKCHECKSc C s
d| _ | S )a�
Ignore the given object during leakchecks.
Can be applied to a method, in which case the method will run, but
will not be subject to leak checks.
If applied to a class, the entire class will be skipped during leakchecks. This
is intended to be used for classes that are very slow and cause problems such as
test timeouts; typically it will be used for classes that are subclasses of a base
class and specify variants of behaviour (such as pool sizes).
T)�ignore_leakcheck��func� r �C/usr/local/lib/python3.10/dist-packages/greenlet/tests/leakcheck.py�ignores_leakcheckL s r c C s d| _ trt�d�| �} | S )z2
Mark that the function is known to leak.
TzSkipping known failures)�fails_leakcheck�SKIP_FAILING_LEAKCHECKS�unittest�skipr r r r r [ s r c @ s e Zd ZdS )�LeakCheckErrorN)�__name__�
__module__�__qualname__r r r r r d s r �
getobjectsc @ � e Zd Zdd� Zdd� ZdS )�_MockGCc C s
t �d�S )Nr )�sysr ��selfr r r �get_objectsl �
z_MockGC.get_objectsc C s
t t|�S �N)�getattr�gc)r �namer r r �__getattr__n r z_MockGC.__getattr__N)r r r r r% r r r r r k � r c C s | S )a
Decorator for a function that is known to fail when running
strict (``sys.getobjects()``) leakchecks.
This type of leakcheck finds all objects, even those, such as
strings, which are not tracked by the garbage collector.
r r r r r �fails_strict_leakchecks s r'