| Server IP : 89.117.53.150 / Your IP : 216.73.216.11 Web Server : Apache System : Linux server2.hostofiraq.site 5.15.0-186-generic #196-Ubuntu SMP Sat Jun 20 16:09:34 UTC 2026 x86_64 User : iscmbt-kufa-atu ( 1014) PHP Version : 8.2.32 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /lib/python3/dist-packages/psutil/tests/__pycache__/ |
Upload File : |
o
���a : � @ s d Z ddlmZ ddlZddlZddlZddlZddlmZ ddlmZ ddlm Z ddlm
Z
ddlmZ dd lmZ dd
l
mZ ddl
mZ ddlmZ dd
lmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlm Z ddlm!Z! ddlm"Z" ddlm#Z# ddlm$Z$ dd lm%Z% ej&j'Z'e�(� Z)d!Z*d"d#� Z+G d$d%� d%e�Z,G d&d'� d'e,�Z-e%�.e d(�G d)d*� d*e��Z/G d+d,� d,e�Z0e1d-k�rdd.l2m3Z3 e3e4� dS dS )/a�
Tests for detecting function memory leaks (typically the ones
implemented in C). It does so by calling a function many times and
checking whether process memory usage keeps increasing between
calls or over time.
Note that this may produce false positives (especially on Windows
for some reason).
PyPy appears to be completely unstable for this framework, probably
because of how its JIT handles memory, so tests are skipped.
� )�print_functionN)�LINUX)�MACOS)�OPENBSD)�POSIX)�SUNOS)�WINDOWS)�ProcessLookupError)�super)�HAS_CPU_AFFINITY)�HAS_CPU_FREQ)�HAS_ENVIRON)�
HAS_IONICE)�HAS_MEMORY_MAPS)�HAS_NET_IO_COUNTERS)�HAS_PROC_CPU_NUM)�HAS_PROC_IO_COUNTERS)�
HAS_RLIMIT)�HAS_SENSORS_BATTERY)�HAS_SENSORS_FANS)�HAS_SENSORS_TEMPERATURES)�TestMemoryLeak)�create_sockets)�
get_testfn)�process_namespace)�skip_on_access_denied)�spawn_testproc)�system_namespace)� terminate)�unittest� c C s dd� } | S )zsDecorator for those Linux functions which are implemented in pure
Python, and which we want to run faster.
c s t �� �� fdd��}|S )Nc sV t r | jj}zt| j_� | g|�R i |��W || j_S || j_w � | g|�R i |��S �N)r � __class__�times� FEW_TIMES)�self�args�kwargs�before��fun� �</usr/lib/python3/dist-packages/psutil/tests/test_memleaks.py�wrapperB s z5fewtimes_if_linux.<locals>.decorator.<locals>.wrapper)� functools�wraps)r* r- r+ r) r, � decoratorA s
z$fewtimes_if_linux.<locals>.decoratorr+ )r0 r+ r+ r, �fewtimes_if_linux= s
r1 c @ s� e Zd ZdZeZdd� Ze� dd� �Ze� dd� �Z e� dd � �Z
e� d
d� �Ze�
e d�e� d
d� ��Ze�
e d�e� dd� ��Ze� dd� �Zdd� Zdd� Ze�
e d�dd� �Ze�
e d�dd� �Ze�
e d�e� dd� ��Ze�
ed�dd � �Ze� d!d"� �Ze� eed#�d$d%� ��Ze�
e d&�d'd(� �Ze�
e d�e� d)d*� ��Z e� d+d,� �Z!e� eed#�d-d.� ��Z"e� d/d0� �Z#e� e�
e$ d�d1d2� ��Z%e� d3d4� �Z&e� d5d6� �Z'e�
e d�e� d7d8� ��Z(d9d:� Z)e� d;d<� �Z*e�
e+ d�d=d>� �Z,e�
e+ d�d?d@� �Z-e� dAdB� �Z.e�
e/ d�e� dCdD� ��Z0e�
e1 dE�e�
e2 d�dFdG� ��Z3e�
e1 dE�e�
e2 d�dHdI� ��Z4e� e�
edJ�dKdL� ��Z5e�
e6 d�dMdN� �Z7e�
e d&�dOdP� �Z8dQS )R�TestProcessObjectLeaksz$Test leaks of Process class methods.c C s t d �}|�| |j|j � d S r! )r �test_class_coverage�getters�setters�r% �nsr+ r+ r, �
test_coverage[ � z$TestProcessObjectLeaks.test_coveragec C � | � | jj� d S r! )�execute�proc�name�r% r+ r+ r, � test_name_ � z TestProcessObjectLeaks.test_namec C r: r! )r; r<