<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"
        integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css"
        integrity="sha512-SzlrxWUlpfuzQ+pcUCosxcglQRNAq/DZjVsC0lE40xsADsfeQoEypE+enwcOiGjk/bSuGGKHEyjSoQ1zVisanQ=="
        crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
</html>
B
    =_9                 @   s  d Z ddlmZ ddlZddlZddlZddlZddlmZ ddlmZ ddlm	Z	 ddlm
Z
 ddlmZ dd	lmZ dd
lmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlm Z  ddlm!Z! ddlm"Z" ddlm#Z# ddlm$Z$ dd lm%Z% ej&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rdd.l2m3Z3 e3e4 dS )/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)create_sockets)
get_testfn)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)process_namespace)skip_on_access_denied)spawn_testproc)system_namespace)	terminate)TestMemoryLeak)unittest   c              C   s   dd } | S )zsDecorator for those Linux functions which are implemented in pure
    Python, and which we want to run faster.
    c                s   t   fdd}|S )Nc                sF   t r2| jj}zt| j_ | f||S || j_X n | f||S d S )N)r   	__class__times	FEW_TIMES)selfargskwargsbefore)fun M/opt/alt/python37/lib64/python3.7/site-packages/psutil/tests/test_memleaks.pywrapperA   s    z5fewtimes_if_linux.<locals>.decorator.<locals>.wrapper)	functoolswraps)r(   r+   r)   )r(   r*   	decorator@   s    z$fewtimes_if_linux.<locals>.decoratorr)   )r.   r)   r)   r*   fewtimes_if_linux<   s    r/   c               @   s  e Zd ZdZeZdd Ze dd Ze dd Z	e dd	 Z
e d
d Zee de dd Zee de dd Ze dd Zdd Zdd Zee ddd Zee ddd Zee de dd Zeeddd  Ze d!d" Ze eed#d$d% Zee d&d'd( Zee de d)d* Z e d+d, Z!e eed#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edJ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 )N)r   test_class_coveragegettersZsetters)r$   nsr)   r)   r*   test_coverageZ   s    z$TestProcessObjectLeaks.test_coveragec             C   s   |  | jj d S )N)executeprocname)r$   r)   r)   r*   	test_name^   s    z TestProcessObjectLeaks.test_namec             C   s   |  | jj d S )N)r5   r6   Zcmdline)r$   r)   r)   r*   test_cmdlineb   s    z#TestProcessObjectLeaks.test_cmdlinec             C   s   |  | jj d S )N)r5   r6   Zexe)r$   r)   r)   r*   test_exef   s    zTestProcessObjectLeaks.test_exec             C   s   |  | jj d S )N)r5   r6   ppid)r$   r)   r)   r*   	test_ppidj   s    z TestProcessObjectLeaks.test_ppidz
POSIX onlyc             C   s   |  | jj d S )N)r5   r6   Zuids)r$   r)   r)   r*   	test_uidsn   s    z TestProcessObjectLeaks.test_uidsc             C   s   |  | jj d S )N)r5   r6   Zgids)r$   r)   r)   r*   	test_gidss   s    z TestProcessObjectLeaks.test_gidsc             C   s   |  | jj d S )N)r5   r6   status)r$   r)   r)   r*   test_statusx   s    z"TestProcessObjectLeaks.test_statusc             C   s   |  | jj d S )N)r5   r6   nice)r$   r)   r)   r*   	test_nice|   s    z TestProcessObjectLeaks.test_nicec                s    t    fdd d S )Nc                  s   j  S )N)r6   rA   r)   )nicenessr$   r)   r*   <lambda>       z6TestProcessObjectLeaks.test_nice_set.<locals>.<lambda>)thisprocrA   r5   )r$   r)   )rC   r$   r*   test_nice_set   s    z$TestProcessObjectLeaks.test_nice_setznot supportedc             C   s   |  | jj d S )N)r5   r6   ionice)r$   r)   r)   r*   test_ionice   s    z"TestProcessObjectLeaks.test_ionicec                sZ   t r"t   fdd n4  fdd ttjt	 dd} 
t| d S )Nc                  s    j S )N)r6   rH   r)   )r$   valuer)   r*   rD      rE   z8TestProcessObjectLeaks.test_ionice_set.<locals>.<lambda>c                  s    j tjS )N)r6   rH   psutilZIOPRIO_CLASS_NONEr)   )r$   r)   r*   rD      rE   r   )r   rF   rH   r5   r,   partialcextZproc_ioprio_setosgetpidexecute_w_excOSError)r$   r(   r)   )r$   rJ   r*   test_ionice_set   s    z&TestProcessObjectLeaks.test_ionice_setc             C   s   |  | jj d S )N)r5   r6   Zio_counters)r$   r)   r)   r*   test_io_counters   s    z'TestProcessObjectLeaks.test_io_counterszworthless on POSIXc             C   s   t    | | jj d S )N)rK   Processusernamer5   r6   )r$   r)   r)   r*   test_username   s    z$TestProcessObjectLeaks.test_usernamec             C   s   |  | jj d S )N)r5   r6   Zcreate_time)r$   r)   r)   r*   test_create_time   s    z'TestProcessObjectLeaks.test_create_time)Zonly_ifc             C   s   |  | jj d S )N)r5   r6   num_threads)r$   r)   r)   r*   test_num_threads   s    z'TestProcessObjectLeaks.test_num_threadszWINDOWS onlyc             C   s   |  | jj d S )N)r5   r6   Znum_handles)r$   r)   r)   r*   test_num_handles   s    z'TestProcessObjectLeaks.test_num_handlesc             C   s   |  | jj d S )N)r5   r6   Znum_fds)r$   r)   r)   r*   test_num_fds   s    z#TestProcessObjectLeaks.test_num_fdsc             C   s   |  | jj d S )N)r5   r6   Znum_ctx_switches)r$   r)   r)   r*   test_num_ctx_switches   s    z,TestProcessObjectLeaks.test_num_ctx_switchesc             C   s   |  | jj d S )N)r5   r6   threads)r$   r)   r)   r*   test_threads   s    z#TestProcessObjectLeaks.test_threadsc             C   s   |  | jj d S )N)r5   r6   	cpu_times)r$   r)   r)   r*   test_cpu_times   s    z%TestProcessObjectLeaks.test_cpu_timesc             C   s   |  | jj d S )N)r5   r6   Zcpu_num)r$   r)   r)   r*   test_cpu_num   s    z#TestProcessObjectLeaks.test_cpu_numc             C   s   |  | jj d S )N)r5   r6   Zmemory_info)r$   r)   r)   r*   test_memory_info   s    z'TestProcessObjectLeaks.test_memory_infoc             C   s   |  | jj d S )N)r5   r6   Zmemory_full_info)r$   r)   r)   r*   test_memory_full_info   s    z,TestProcessObjectLeaks.test_memory_full_infoc             C   s   |  | jj d S )N)r5   r6   terminal)r$   r)   r)   r*   test_terminal   s    z$TestProcessObjectLeaks.test_terminalc             C   s$   t rtn| j}| j| jj|d d S )N)r"   )r   r#   r"   r5   r6   resume)r$   r"   r)   r)   r*   test_resume   s    z"TestProcessObjectLeaks.test_resumec             C   s   |  | jj d S )N)r5   r6   cwd)r$   r)   r)   r*   test_cwd   s    zTestProcessObjectLeaks.test_cwdc             C   s   |  | jj d S )N)r5   r6   cpu_affinity)r$   r)   r)   r*   test_cpu_affinity   s    z(TestProcessObjectLeaks.test_cpu_affinityc                s4   t    fdd tfdd d S )Nc                  s   j  S )N)r6   rk   r)   )affinityr$   r)   r*   rD      rE   z>TestProcessObjectLeaks.test_cpu_affinity_set.<locals>.<lambda>c                  s    j dgS )NrL   )r6   rk   r)   )r$   r)   r*   rD      rE   )rF   rk   r5   rQ   
ValueError)r$   r)   )rm   r$   r*   test_cpu_affinity_set   s    z,TestProcessObjectLeaks.test_cpu_affinity_setc          	   C   s*   t t d | | jj W d Q R X d S )Nw)openr   r5   r6   Z
open_files)r$   r)   r)   r*   test_open_files   s    z&TestProcessObjectLeaks.test_open_filesc             C   s   |  | jj d S )N)r5   r6   Zmemory_maps)r$   r)   r)   r*   test_memory_maps   s    z'TestProcessObjectLeaks.test_memory_mapsz
LINUX onlyc                s      fdd d S )Nc                  s    j tjS )N)r6   rlimitrK   RLIMIT_NOFILEr)   )r$   r)   r*   rD      rE   z4TestProcessObjectLeaks.test_rlimit.<locals>.<lambda>)r5   )r$   r)   )r$   r*   test_rlimit   s    z"TestProcessObjectLeaks.test_rlimitc                s<   t tj  fdd ttffdd d S )Nc                  s   j tj S )N)r6   rt   rK   ru   r)   )limitr$   r)   r*   rD      rE   z8TestProcessObjectLeaks.test_rlimit_set.<locals>.<lambda>c                  s    j dS )NrL   )r6   rt   r)   )r$   r)   r*   rD      rE   )rF   rt   rK   ru   r5   rQ   rR   rn   )r$   r)   )rw   r$   r*   test_rlimit_set   s    z&TestProcessObjectLeaks.test_rlimit_setzworthless on WINDOWSc          	      s6   t  & trdnd  fdd W d Q R X d S )Ninetallc                  s   j  S )N)r6   Zconnectionsr)   )kindr$   r)   r*   rD      rE   z9TestProcessObjectLeaks.test_connections.<locals>.<lambda>)r   r   r5   )r$   r)   )r{   r$   r*   test_connections   s    z'TestProcessObjectLeaks.test_connectionsc             C   s   |  | jj d S )N)r5   r6   environ)r$   r)   r)   r*   test_environ  s    z#TestProcessObjectLeaks.test_environc             C   s   |  dd  d S )Nc               S   s   t t S )N)rN   	proc_inforO   rP   r)   r)   r)   r*   rD     rE   z7TestProcessObjectLeaks.test_proc_info.<locals>.<lambda>)r5   )r$   r)   r)   r*   test_proc_info  s    z%TestProcessObjectLeaks.test_proc_infoN)9__name__
__module____qualname____doc__rF   r6   r4   r/   r8   r9   r:   r<   r   skipIfr   r=   r>   r@   rB   rG   r   rI   rS   r   rT   rW   rX   r   r   rZ   r   r[   r\   r]   r_   ra   r   rb   rc   rd   rf   rh   rj   r   rl   ro   rr   r   rs   r   r   rv   rx   r|   r   r~   r   r)   r)   r)   r*   r0   U   sd   
	r0   c                   sp   e Zd ZdZe fddZe fddZdd Zerhdd	 Z	d
d Z
dd Zdd Zdd Zdd Z  ZS )TestTerminatedProcessLeakszRepeat the tests above looking for leaks occurring when dealing
    with terminated processes raising NoSuchProcess exception.
    The C functions are still invoked but will follow different code
    paths. We'll check those code paths.
    c                s:   t    t | _t| jj| _| j  | j	  d S )N)
r
   
setUpClassr   subprK   rU   pidr6   killwait)cls)r!   r)   r*   r     s
    

z%TestTerminatedProcessLeaks.setUpClassc                s   t    t| j d S )N)r
   tearDownClassr   r   )r   )r!   r)   r*   r     s    
z(TestTerminatedProcessLeaks.tearDownClassc             C   s&   y
|  W n t jk
r    Y nX d S )N)rK   NoSuchProcess)r$   r(   r)   r)   r*   call  s    
zTestTerminatedProcessLeaks.callc             C   s   |  | jj d S )N)r5   r6   r   )r$   r)   r)   r*   	test_kill'  s    z$TestTerminatedProcessLeaks.test_killc             C   s   |  | jj d S )N)r5   r6   r   )r$   r)   r)   r*   test_terminate*  s    z)TestTerminatedProcessLeaks.test_terminatec             C   s   |  | jj d S )N)r5   r6   Zsuspend)r$   r)   r)   r*   test_suspend-  s    z'TestTerminatedProcessLeaks.test_suspendc             C   s   |  | jj d S )N)r5   r6   rg   )r$   r)   r)   r*   rh   0  s    z&TestTerminatedProcessLeaks.test_resumec             C   s   |  | jj d S )N)r5   r6   r   )r$   r)   r)   r*   	test_wait3  s    z$TestTerminatedProcessLeaks.test_waitc                s    fdd}  | d S )Nc                  s(   yt  jjS  tk
r"   Y nX d S )N)rN   r   r6   r   r	   r)   )r$   r)   r*   r   8  s    z7TestTerminatedProcessLeaks.test_proc_info.<locals>.call)r5   )r$   r   r)   )r$   r*   r   6  s    z)TestTerminatedProcessLeaks.test_proc_info)r   r   r   r   classmethodr   r   r   r   r   r   r   rh   r   r   __classcell__r)   r)   )r!   r*   r     s   r   zWINDOWS onlyc               @   s   e Zd Zdd Zdd ZdS )TestProcessDualImplementationc             C   s   |  dd  d S )Nc               S   s   t jt ddS )NT)use_peb)rN   proc_cmdlinerO   rP   r)   r)   r)   r*   rD   E  rE   zETestProcessDualImplementation.test_cmdline_peb_true.<locals>.<lambda>)r5   )r$   r)   r)   r*   test_cmdline_peb_trueD  s    z3TestProcessDualImplementation.test_cmdline_peb_truec             C   s   |  dd  d S )Nc               S   s   t jt ddS )NF)r   )rN   r   rO   rP   r)   r)   r)   r*   rD   H  rE   zFTestProcessDualImplementation.test_cmdline_peb_false.<locals>.<lambda>)r5   )r$   r)   r)   r*   test_cmdline_peb_falseG  s    z4TestProcessDualImplementation.test_cmdline_peb_falseN)r   r   r   r   r   r)   r)   r)   r*   r   A  s   r   c               @   s  e Zd ZdZdd Ze dd Ze dd Ze dd	 Ze d
d Z	e dd Z
e ee ddd Zee ddd Zdd Zeeddd Zdd Zdd Zdd Zeeoejd d e d!d" Ze d#d$ Ze ee dd%d& Ze eeo*e  d'kd(d)d* Z!d+d, Z"d-d. Z#e ee$ dd/d0 Z%e ee& dd1d2 Z'e ee( dd3d4 Z)e d5d6 Z*d7d8 Z+erd9d: Z,d;d< Z-d=d> Z.d?d@ Z/dAdB Z0dCS )DTestModuleFunctionsLeaksz&Test leaks of psutil module functions.c             C   s   t  }|| |j d S )N)r   r1   rz   )r$   r3   r)   r)   r*   r4   S  s    z&TestModuleFunctionsLeaks.test_coveragec             C   s   |  dd  d S )Nc               S   s   t jddS )NT)logical)rK   	cpu_countr)   r)   r)   r*   rD   [  rE   z9TestModuleFunctionsLeaks.test_cpu_count.<locals>.<lambda>)r5   )r$   r)   r)   r*   test_cpu_countY  s    z'TestModuleFunctionsLeaks.test_cpu_countc             C   s   |  dd  d S )Nc               S   s   t jddS )NF)r   )rK   r   r)   r)   r)   r*   rD   _  rE   zBTestModuleFunctionsLeaks.test_cpu_count_physical.<locals>.<lambda>)r5   )r$   r)   r)   r*   test_cpu_count_physical]  s    z0TestModuleFunctionsLeaks.test_cpu_count_physicalc             C   s   |  tj d S )N)r5   rK   r`   )r$   r)   r)   r*   ra   a  s    z'TestModuleFunctionsLeaks.test_cpu_timesc             C   s   |  dd  d S )Nc               S   s   t jddS )NT)Zpercpu)rK   r`   r)   r)   r)   r*   rD   g  rE   z=TestModuleFunctionsLeaks.test_per_cpu_times.<locals>.<lambda>)r5   )r$   r)   r)   r*   test_per_cpu_timese  s    z+TestModuleFunctionsLeaks.test_per_cpu_timesc             C   s   |  tj d S )N)r5   rK   Z	cpu_stats)r$   r)   r)   r*   test_cpu_statsi  s    z'TestModuleFunctionsLeaks.test_cpu_statsznot supportedc             C   s   |  tj d S )N)r5   rK   Zcpu_freq)r$   r)   r)   r*   test_cpu_freqm  s    z&TestModuleFunctionsLeaks.test_cpu_freqzWINDOWS onlyc             C   s   t   | t j d S )N)rK   
getloadavgr5   )r$   r)   r)   r*   test_getloadavgr  s    z(TestModuleFunctionsLeaks.test_getloadavgc             C   s   |  tj d S )N)r5   rK   Zvirtual_memory)r$   r)   r)   r*   test_virtual_memoryy  s    z,TestModuleFunctionsLeaks.test_virtual_memoryz&worthless on SUNOS (uses a subprocess)c             C   s   |  tj d S )N)r5   rK   Zswap_memory)r$   r)   r)   r*   test_swap_memory}  s    z)TestModuleFunctionsLeaks.test_swap_memoryc             C   s$   t rtn| j}| jdd |d d S )Nc               S   s   t t S )N)rK   Z
pid_existsrO   rP   r)   r)   r)   r*   rD     rE   z:TestModuleFunctionsLeaks.test_pid_exists.<locals>.<lambda>)r"   )r   r#   r"   r5   )r$   r"   r)   r)   r*   test_pid_exists  s    z(TestModuleFunctionsLeaks.test_pid_existsc             C   s$   t rtn| j}| jdd |d d S )Nc               S   s
   t dS )N.)rK   
disk_usager)   r)   r)   r*   rD     rE   z:TestModuleFunctionsLeaks.test_disk_usage.<locals>.<lambda>)r"   )r   r#   r"   r5   )r$   r"   r)   r)   r*   test_disk_usage  s    z(TestModuleFunctionsLeaks.test_disk_usagec             C   s   |  tj d S )N)r5   rK   Zdisk_partitions)r$   r)   r)   r*   test_disk_partitions  s    z-TestModuleFunctionsLeaks.test_disk_partitionsz/proc/diskstatsz3/proc/diskstats not available on this Linux versionc             C   s   |  dd  d S )Nc               S   s   t jddS )NF)nowrap)rK   Zdisk_io_countersr)   r)   r)   r*   rD     rE   z@TestModuleFunctionsLeaks.test_disk_io_counters.<locals>.<lambda>)r5   )r$   r)   r)   r*   test_disk_io_counters  s    z.TestModuleFunctionsLeaks.test_disk_io_countersc             C   s   |  tj d S )N)r5   rK   Zpids)r$   r)   r)   r*   	test_pids  s    z"TestModuleFunctionsLeaks.test_pidsc             C   s   |  dd  d S )Nc               S   s   t jddS )NF)r   )rK   Znet_io_countersr)   r)   r)   r*   rD     rE   z?TestModuleFunctionsLeaks.test_net_io_counters.<locals>.<lambda>)r5   )r$   r)   r)   r*   test_net_io_counters  s    z-TestModuleFunctionsLeaks.test_net_io_countersr   zneed root accessc          	   C   s0   t jdd t  | dd  W d Q R X d S )Nrz   )r{   c               S   s   t jddS )Nrz   )r{   )rK   net_connectionsr)   r)   r)   r*   rD     rE   z?TestModuleFunctionsLeaks.test_net_connections.<locals>.<lambda>)rK   r   r   r5   )r$   r)   r)   r*   test_net_connections  s    z-TestModuleFunctionsLeaks.test_net_connectionsc             C   s"   t rdn| j}| jtj|d d S )Ni @ )	tolerance)r   r   r5   rK   Znet_if_addrs)r$   r   r)   r)   r*   test_net_if_addrs  s    z*TestModuleFunctionsLeaks.test_net_if_addrsc             C   s   |  tj d S )N)r5   rK   Znet_if_stats)r$   r)   r)   r*   test_net_if_stats  s    z*TestModuleFunctionsLeaks.test_net_if_statsc             C   s   |  tj d S )N)r5   rK   Zsensors_battery)r$   r)   r)   r*   test_sensors_battery  s    z-TestModuleFunctionsLeaks.test_sensors_batteryc             C   s   |  tj d S )N)r5   rK   Zsensors_temperatures)r$   r)   r)   r*   test_sensors_temperatures  s    z2TestModuleFunctionsLeaks.test_sensors_temperaturesc             C   s   |  tj d S )N)r5   rK   Zsensors_fans)r$   r)   r)   r*   test_sensors_fans  s    z*TestModuleFunctionsLeaks.test_sensors_fansc             C   s   |  tj d S )N)r5   rK   Z	boot_time)r$   r)   r)   r*   test_boot_time  s    z'TestModuleFunctionsLeaks.test_boot_timec             C   s   |  tj d S )N)r5   rK   Zusers)r$   r)   r)   r*   
test_users  s    z#TestModuleFunctionsLeaks.test_usersc             C   s   |  tj d S )N)r5   rN   Zwinservice_enumerate)r$   r)   r)   r*   test_win_service_iter  s    z.TestModuleFunctionsLeaks.test_win_service_iterc             C   s   d S )Nr)   )r$   r)   r)   r*   test_win_service_get  s    z-TestModuleFunctionsLeaks.test_win_service_getc                s&   t t   |  fdd d S )Nc                  s
   t  S )N)rN   Zwinservice_query_configr)   )r7   r)   r*   rD     rE   zFTestModuleFunctionsLeaks.test_win_service_get_config.<locals>.<lambda>)nextrK   win_service_iterr7   r5   )r$   r)   )r7   r*   test_win_service_get_config  s    z4TestModuleFunctionsLeaks.test_win_service_get_configc                s&   t t   |  fdd d S )Nc                  s
   t  S )N)rN   Zwinservice_query_statusr)   )r7   r)   r*   rD     rE   zFTestModuleFunctionsLeaks.test_win_service_get_status.<locals>.<lambda>)r   rK   r   r7   r5   )r$   r)   )r7   r*   test_win_service_get_status  s    z4TestModuleFunctionsLeaks.test_win_service_get_statusc                s&   t t   |  fdd d S )Nc                  s
   t  S )N)rN   Zwinservice_query_descrr)   )r7   r)   r*   rD     rE   zKTestModuleFunctionsLeaks.test_win_service_get_description.<locals>.<lambda>)r   rK   r   r7   r5   )r$   r)   )r7   r*    test_win_service_get_description  s    z9TestModuleFunctionsLeaks.test_win_service_get_descriptionN)1r   r   r   r   r4   r/   r   r   ra   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   rO   pathexistsr   r   r   r   r   getuidr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r)   r)   r)   r*   r   P  sN   $r   __main__)run_from_name)5r   
__future__r   r,   rO   rK   Zpsutil._commonr   r   r   r   r   r   Zpsutil._compatr	   r
   Zpsutil.testsr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   Z_psplatformrN   rU   rF   r#   r/   r0   r   r   r   r   r   Zpsutil.tests.runnerr   __file__r)   r)   r)   r*   <module>   s`    76 
