
    g3<                        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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& dd!lm'Z' ejP                  jR                  Z) ejT                         Z+d"Z,d# Z- G d$ d%e      Z. G d& d'e.      Z/e#j`                  jc                  e d()       G d* d+e             Z2 G d, d-e      Z3y).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)	QEMU_USER)TestMemoryLeak)create_sockets)
get_testfn)process_namespace)pytest)skip_on_access_denied)spawn_testproc)system_namespace)	terminate   c                      d } | S )zsDecorator for those Linux functions which are implemented in pure
    Python, and which we want to run faster.
    c                 B     t        j                          fd       }|S )Nc                     t         rI| j                  j                  }	 t        | j                  _         | g|i ||| j                  _        S  | g|i |S # || j                  _        w xY wN)r   	__class__times	FEW_TIMES)selfargskwargsbeforefuns       O/var/www/openai/venv/lib/python3.12/site-packages/psutil/tests/test_memleaks.pywrapperz5fewtimes_if_linux.<locals>.decorator.<locals>.wrapperD   si    --2+4DNN(t5d5f5+1DNN(41$1&11 ,2DNN(s    A A0)	functoolswraps)r.   r0   s   ` r/   	decoratorz$fewtimes_if_linux.<locals>.decoratorC   s%    				2 
		2      )r3   s    r/   fewtimes_if_linuxr6   >   s    
 r4   c                      e Zd ZdZeZd Z e       d        Z e       d        Z	 e       d        Z
 e       d        Zej                  j                  e d       e       d	               Zej                  j                  e d       e       d
               Z e       d        Zd Zd Zej                  j                  e d      d        Zej                  j                  e d      d        Zej                  j                  e d       e       d               Zej                  j                  ed      d        Z e       d        Z e        ee      d               Zej                  j                  e d      d        Z ej                  j                  e d       e       d               Z! e       d        Z" e        ee      d               Z# e       d        Z$ e       ej                  j                  e% d      d               Z& e       d        Z' e       d        Z(ej                  j                  e d       e       d                Z)d! Z* e       d"        Z+ej                  j                  e, d      d#        Z-ej                  j                  e, d      d$        Z. e       d%        Z/ej                  j                  e0 d       e       d&               Z1ej                  j                  e2 d'      ej                  j                  e3 d      d(               Z4ej                  j                  e2 d'      ej                  j                  e3 d      d)               Z5 e       ej                  j                  ed*      d+               Z6ej                  j                  e7 d      d,        Z8ej                  j                  e d      d-        Z9y.)/TestProcessObjectLeaksz$Test leaks of Process class methods.c                 l    t        d       }|j                  | |j                  |j                  z          y r&   )r   test_class_coveragegetterssettersr*   nss     r/   test_coveragez$TestProcessObjectLeaks.test_coverage_   s)    t$
tRZZ"**%<=r4   c                 N    | j                  | j                  j                         y r&   )executeprocnamer*   s    r/   	test_namez TestProcessObjectLeaks.test_namec       TYY^^$r4   c                 N    | j                  | j                  j                         y r&   )rA   rB   cmdlinerD   s    r/   test_cmdlinez#TestProcessObjectLeaks.test_cmdlineg       TYY&&'r4   c                 N    | j                  | j                  j                         y r&   )rA   rB   exerD   s    r/   test_exezTestProcessObjectLeaks.test_exek       TYY]]#r4   c                 N    | j                  | j                  j                         y r&   )rA   rB   ppidrD   s    r/   	test_ppidz TestProcessObjectLeaks.test_ppido   rF   r4   z
POSIX onlyreasonc                 N    | j                  | j                  j                         y r&   )rA   rB   uidsrD   s    r/   	test_uidsz TestProcessObjectLeaks.test_uidss        	TYY^^$r4   c                 N    | j                  | j                  j                         y r&   )rA   rB   gidsrD   s    r/   	test_gidsz TestProcessObjectLeaks.test_gidsx   rW   r4   c                 N    | j                  | j                  j                         y r&   )rA   rB   statusrD   s    r/   test_statusz"TestProcessObjectLeaks.test_status}       TYY%%&r4   c                 N    | j                  | j                  j                         y r&   )rA   rB   nicerD   s    r/   	test_nicez TestProcessObjectLeaks.test_nice   s    TYY^^$r4   c                 Z     t         j                          j                   fd       y )Nc                  :    j                   j                         S r&   )rB   r`   )nicenessr*   s   r/   <lambda>z6TestProcessObjectLeaks.test_nice_set.<locals>.<lambda>   s    TYY^^H5r4   )thisprocr`   rA   )r*   rd   s   `@r/   test_nice_setz$TestProcessObjectLeaks.test_nice_set   s    ==?56r4   not supportedc                 N    | j                  | j                  j                         y r&   )rA   rB   ionicerD   s    r/   test_ionicez"TestProcessObjectLeaks.test_ionice   r^   r4   c                 ,    t         r*t        j                          j                   fd       y  j                   fd       t	        j
                  t        j                  t        j                         dd      } j                  t        |       y )Nc                  :     j                   j                        S r&   )rB   rj   )r*   values   r/   re   z8TestProcessObjectLeaks.test_ionice_set.<locals>.<lambda>   s    !1!1%!8r4   c                  V     j                   j                  t        j                        S r&   )rB   rj   psutilIOPRIO_CLASS_NONErD   s   r/   re   z8TestProcessObjectLeaks.test_ionice_set.<locals>.<lambda>   s    !1!1&2J2J!Kr4   r   )r	   rf   rj   rA   r1   partialcextproc_ioprio_setosgetpidexecute_w_excOSError)r*   r.   rn   s   ` @r/   test_ionice_setz&TestProcessObjectLeaks.test_ionice_set   s^    OO%ELL89LLKL##D$8$8"))+r1MCw,r4   c                 N    | j                  | j                  j                         y r&   )rA   rB   io_countersrD   s    r/   test_io_countersz'TestProcessObjectLeaks.test_io_counters        	TYY**+r4   zworthless on POSIXc                     t        j                         j                          | j                  | j                  j                         y r&   )rp   ProcessusernamerA   rB   rD   s    r/   test_usernamez$TestProcessObjectLeaks.test_username   s-     	!!#TYY''(r4   c                 N    | j                  | j                  j                         y r&   )rA   rB   create_timerD   s    r/   test_create_timez'TestProcessObjectLeaks.test_create_time       TYY**+r4   )only_ifc                 N    | j                  | j                  j                         y r&   )rA   rB   num_threadsrD   s    r/   test_num_threadsz'TestProcessObjectLeaks.test_num_threads   r~   r4   WINDOWS onlyc                 N    | j                  | j                  j                         y r&   )rA   rB   num_handlesrD   s    r/   test_num_handlesz'TestProcessObjectLeaks.test_num_handles   r   r4   c                 N    | j                  | j                  j                         y r&   )rA   rB   num_fdsrD   s    r/   test_num_fdsz#TestProcessObjectLeaks.test_num_fds        	TYY&&'r4   c                 N    | j                  | j                  j                         y r&   )rA   rB   num_ctx_switchesrD   s    r/   test_num_ctx_switchesz,TestProcessObjectLeaks.test_num_ctx_switches       TYY//0r4   c                 N    | j                  | j                  j                         y r&   )rA   rB   threadsrD   s    r/   test_threadsz#TestProcessObjectLeaks.test_threads   r   r4   c                 N    | j                  | j                  j                         y r&   )rA   rB   	cpu_timesrD   s    r/   test_cpu_timesz%TestProcessObjectLeaks.test_cpu_times   s    TYY(()r4   c                 N    | j                  | j                  j                         y r&   )rA   rB   cpu_numrD   s    r/   test_cpu_numz#TestProcessObjectLeaks.test_cpu_num   r   r4   c                 N    | j                  | j                  j                         y r&   )rA   rB   memory_inforD   s    r/   test_memory_infoz'TestProcessObjectLeaks.test_memory_info   r   r4   c                 N    | j                  | j                  j                         y r&   )rA   rB   memory_full_inforD   s    r/   test_memory_full_infoz,TestProcessObjectLeaks.test_memory_full_info   r   r4   c                 N    | j                  | j                  j                         y r&   )rA   rB   terminalrD   s    r/   test_terminalz$TestProcessObjectLeaks.test_terminal   s     	TYY''(r4   c                     t         rt        n| j                  }| j                  | j                  j
                  |       y )Nr(   )r   r)   r(   rA   rB   resumer*   r(   s     r/   test_resumez"TestProcessObjectLeaks.test_resume   s)    "	

TYY%%U3r4   c                 N    | j                  | j                  j                         y r&   )rA   rB   cwdrD   s    r/   test_cwdzTestProcessObjectLeaks.test_cwd   rN   r4   c                 N    | j                  | j                  j                         y r&   )rA   rB   cpu_affinityrD   s    r/   test_cpu_affinityz(TestProcessObjectLeaks.test_cpu_affinity   s    TYY++,r4   c                      t         j                          j                   fd        j                  t         fd       y )Nc                  :    j                   j                         S r&   rB   r   )affinityr*   s   r/   re   z>TestProcessObjectLeaks.test_cpu_affinity_set.<locals>.<lambda>   s    TYY33H=r4   c                  <     j                   j                  dg      S Nrr   r   rD   s   r/   re   z>TestProcessObjectLeaks.test_cpu_affinity_set.<locals>.<lambda>   s    tyy/E/Erd/Kr4   )rf   r   rA   rx   
ValueError)r*   r   s   `@r/   test_cpu_affinity_setz,TestProcessObjectLeaks.test_cpu_affinity_set   s/    ((*=>:'KLr4   c                     t        t               d      5  | j                  | j                  j                         d d d        y # 1 sw Y   y xY w)Nw)openr   rA   rB   
open_filesrD   s    r/   test_open_filesz&TestProcessObjectLeaks.test_open_files   s0    *,$LL--. %$$s   &AAc                 N    | j                  | j                  j                         y r&   )rA   rB   memory_mapsrD   s    r/   test_memory_mapsz'TestProcessObjectLeaks.test_memory_maps   r~   r4   z
LINUX onlyc                 .      j                   fd       y )Nc                  V     j                   j                  t        j                        S r&   rB   rlimitrp   RLIMIT_NOFILErD   s   r/   re   z4TestProcessObjectLeaks.test_rlimit.<locals>.<lambda>   s    TYY--f.B.BCr4   rA   rD   s   `r/   test_rlimitz"TestProcessObjectLeaks.test_rlimit   s     	CDr4   c                      t         j                  t        j                         j	                   fd        j                  t        t        f fd       y )Nc                  X    j                   j                  t        j                         S r&   r   )limitr*   s   r/   re   z8TestProcessObjectLeaks.test_rlimit_set.<locals>.<lambda>   s    TYY--f.B.BEJr4   c                  :     j                   j                  d      S r   )rB   r   rD   s   r/   re   z8TestProcessObjectLeaks.test_rlimit_set.<locals>.<lambda>   s    $)):J:J2:Nr4   )rf   r   rp   r   rA   rx   ry   r   )r*   r   s   `@r/   test_rlimit_setz&TestProcessObjectLeaks.test_rlimit_set   s<      4 45JKGZ02NOr4   zworthless on WINDOWSc                      t               5  t        rdnd j                   fd       d d d        y # 1 sw Y   y xY w)Ninetallc                  :    j                   j                         S r&   )rB   net_connections)kindr*   s   r/   re   z=TestProcessObjectLeaks.test_net_connections.<locals>.<lambda>  s    !:!:4!@r4   )r   r   rA   )r*   r   s   `@r/   test_net_connectionsz+TestProcessObjectLeaks.test_net_connections   s-     "6DLL@A s    6?c                 N    | j                  | j                  j                         y r&   )rA   rB   environrD   s    r/   test_environz#TestProcessObjectLeaks.test_environ  rJ   r4   c                 (    | j                  d        y )Nc                  P    t         j                  t        j                               S r&   )rt   	proc_inforv   rw   r5   r4   r/   re   z7TestProcessObjectLeaks.test_proc_info.<locals>.<lambda>  s    T^^BIIK8r4   r   rD   s    r/   test_proc_infoz%TestProcessObjectLeaks.test_proc_info
  s    89r4   N):__name__
__module____qualname____doc__rf   rB   r?   r6   rE   rI   rM   rQ   r   markskipifr   rV   rZ   r]   ra   rg   r   rk   rz   r   r}   r   r   r   r   r   r	   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r5   r4   r/   r8   r8   Z   s   .D> % % ( ( $ $ % % [[E	,7%  8% [[E	,7%  8% ' '%7 [[J?' @' [[J?- @- [[00I,  J, [[&:;) <)
 , , 7+, , , [[GN;, <, [[E	,7(  8( 1 1 7+( , ( * * [[,,_E( F ( , , 1 1 [[E	,7)  8)4 $ $ [[,,_E- F- [[,,_EM FM
 / / [[O+OD,  E, [[E	,7[[J?E @ 8E [[E	,7[[J?P @ 8P
  [[(>?B @ B [[K@( A( [[GN;: <:r4   r8   c                   v     e Zd ZdZe fd       Ze fd       Zd Zerd Z	d Z
d Zd Zd	 Zd
 Z xZS  x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                    t               j                          t               | _        t	        j
                  | j                  j                        | _        | j                  j                          | j                  j                          y r&   )
r   
setUpClassr   subprp   r   pidrB   killwaitclsr'   s    r/   r   z%TestTerminatedProcessLeaks.setUpClass  sM    !#>>#((,,/r4   c                 `    t               j                          t        | j                         y r&   )r   tearDownClassr!   r   r   s    r/   r   z(TestTerminatedProcessLeaks.tearDownClass  s    #((r4   c                 F    	  |        y # t         j                  $ r Y y w xY wr&   )rp   NoSuchProcess)r*   r.   s     r/   callzTestTerminatedProcessLeaks.call#  s$    	E## 		s   
   c                 N    | j                  | j                  j                         y r&   )rA   rB   r   rD   s    r/   	test_killz$TestTerminatedProcessLeaks.test_kill+      LL(r4   c                 N    | j                  | j                  j                         y r&   )rA   rB   r!   rD   s    r/   test_terminatez)TestTerminatedProcessLeaks.test_terminate.  s    LL,,-r4   c                 N    | j                  | j                  j                         y r&   )rA   rB   suspendrD   s    r/   test_suspendz'TestTerminatedProcessLeaks.test_suspend1  s    LL**+r4   c                 N    | j                  | j                  j                         y r&   )rA   rB   r   rD   s    r/   r   z&TestTerminatedProcessLeaks.test_resume4  s    LL))*r4   c                 N    | j                  | j                  j                         y r&   )rA   rB   r   rD   s    r/   	test_waitz$TestTerminatedProcessLeaks.test_wait7  r   r4   c                 2      fd} j                  |       y )Nc                  v    	 t         j                   j                  j                        S # t        $ r Y y w xY wr&   )rt   r   rB   r   r
   rD   s   r/   r   z7TestTerminatedProcessLeaks.test_proc_info.<locals>.call<  s1    >>$))--88) s   (, 	88r   )r*   r   s   ` r/   r   z)TestTerminatedProcessLeaks.test_proc_info:  s     LLr4   )r   r   r   r   classmethodr   r   r   r	   r   r   r   r   r   r   __classcell__)r'   s   @r/   r   r     s]         	)	.	,	+	)	# r4   r   r   rR   c                       e Zd Zd Zd Zy)TestProcessDualImplementationc                 (    | j                  d        y )Nc                  T    t         j                  t        j                         d      S )NTuse_pebrt   proc_cmdlinerv   rw   r5   r4   r/   re   zETestProcessDualImplementation.test_cmdline_peb_true.<locals>.<lambda>H  s    T..ryy{D.Ir4   r   rD   s    r/   test_cmdline_peb_truez3TestProcessDualImplementation.test_cmdline_peb_trueG  s    IJr4   c                 (    | j                  d        y )Nc                  T    t         j                  t        j                         d      S )NFr  r  r5   r4   r/   re   zFTestProcessDualImplementation.test_cmdline_peb_false.<locals>.<lambda>K  s    T..ryy{E.Jr4   r   rD   s    r/   test_cmdline_peb_falsez4TestProcessDualImplementation.test_cmdline_peb_falseJ  s    JKr4   N)r   r   r   r
  r  r5   r4   r/   r  r  E  s    KLr4   r  c                      e Zd ZdZd Z e       d        Z e       d        Z e       d        Z e       d        Z	 e       d        Z
 e       ej                  j                  exr  ej                          dk(  d	
      ej                  j                  e d
      d                      Zej                  j                  e d
      d        Zd Zej                  j                  ed
      d        Zd Zd Zej                  j                  ed
      d        Zej                  j                  exr ej<                  j?                  d       d
       e       d               Z  e       d        Z! e       ej                  j                  e" d
      d               Z# e       ej                  j                  exr  ejH                         dk7  d
      d               Z%d Z&ej                  j                  ed
      d        Z' e       ej                  j                  e( d
      d                Z) e       ej                  j                  e* d
      d!               Z+ e       ej                  j                  e, d
      d"               Z- e       d#        Z.d$ Z/d% Z0erd& Z1d' Z2d( Z3d) Z4d* Z5y+y+),TestModuleFunctionsLeaksz&Test leaks of psutil module functions.c                 P    t               }|j                  | |j                         y r&   )r    r:   r   r=   s     r/   r?   z&TestModuleFunctionsLeaks.test_coverageV  s    
tRVV,r4   c                 (    | j                  d        y )Nc                  .    t        j                  d      S )NTlogicalrp   	cpu_countr5   r4   r/   re   z9TestModuleFunctionsLeaks.test_cpu_count.<locals>.<lambda>^  s    V--d;r4   r   rD   s    r/   test_cpu_countz'TestModuleFunctionsLeaks.test_cpu_count\  s    ;<r4   c                 (    | j                  d        y )Nc                  .    t        j                  d      S )NFr  r  r5   r4   r/   re   z?TestModuleFunctionsLeaks.test_cpu_count_cores.<locals>.<lambda>b  s    V--e<r4   r   rD   s    r/   test_cpu_count_coresz-TestModuleFunctionsLeaks.test_cpu_count_cores`  s    <=r4   c                 B    | j                  t        j                         y r&   )rA   rp   r   rD   s    r/   r   z'TestModuleFunctionsLeaks.test_cpu_timesd      V%%&r4   c                 (    | j                  d        y )Nc                  .    t        j                  d      S )NT)percpu)rp   r   r5   r4   r/   re   z=TestModuleFunctionsLeaks.test_per_cpu_times.<locals>.<lambda>j  s    V--T:r4   r   rD   s    r/   test_per_cpu_timesz+TestModuleFunctionsLeaks.test_per_cpu_timesh  s    :;r4   c                 B    | j                  t        j                         y r&   )rA   rp   	cpu_statsrD   s    r/   test_cpu_statsz'TestModuleFunctionsLeaks.test_cpu_statsl  r  r4   arm64zskipped due to #1892rR   rh   c                 B    | j                  t        j                         y r&   )rA   rp   cpu_freqrD   s    r/   test_cpu_freqz&TestModuleFunctionsLeaks.test_cpu_freqp  s     	V__%r4   r   c                 j    t        j                          | j                  t         j                         y r&   )rp   
getloadavgrA   rD   s    r/   test_getloadavgz(TestModuleFunctionsLeaks.test_getloadavgy  s     V&&'r4   c                 B    | j                  t        j                         y r&   )rA   rp   virtual_memoryrD   s    r/   test_virtual_memoryz,TestModuleFunctionsLeaks.test_virtual_memory  s    V**+r4   z&worthless on SUNOS (uses a subprocess)c                 B    | j                  t        j                         y r&   )rA   rp   swap_memoryrD   s    r/   test_swap_memoryz)TestModuleFunctionsLeaks.test_swap_memory  s    V''(r4   c                 \    t         rt        n| j                  }| j                  d |       y )Nc                  P    t        j                  t        j                               S r&   )rp   
pid_existsrv   rw   r5   r4   r/   re   z:TestModuleFunctionsLeaks.test_pid_exists.<locals>.<lambda>  s    V..ryy{;r4   r   r   r)   r(   rA   r   s     r/   test_pid_existsz(TestModuleFunctionsLeaks.test_pid_exists  s     "	

;5Ir4   c                 \    t         rt        n| j                  }| j                  d |       y )Nc                  ,    t        j                  d      S )N.)rp   
disk_usager5   r4   r/   re   z:TestModuleFunctionsLeaks.test_disk_usage.<locals>.<lambda>  s    V..s3r4   r   r4  r   s     r/   test_disk_usagez(TestModuleFunctionsLeaks.test_disk_usage  s     "	

35Ar4   zQEMU user not supportedc                 B    | j                  t        j                         y r&   )rA   rp   disk_partitionsrD   s    r/   test_disk_partitionsz-TestModuleFunctionsLeaks.test_disk_partitions  s    V++,r4   z/proc/diskstatsz3/proc/diskstats not available on this Linux versionc                 (    | j                  d        y )Nc                  .    t        j                  d      S NF)nowrap)rp   disk_io_countersr5   r4   r/   re   z@TestModuleFunctionsLeaks.test_disk_io_counters.<locals>.<lambda>  s    V44EBr4   r   rD   s    r/   test_disk_io_countersz.TestModuleFunctionsLeaks.test_disk_io_counters  s     	BCr4   c                 B    | j                  t        j                         y r&   )rA   rp   pidsrD   s    r/   	test_pidsz"TestModuleFunctionsLeaks.test_pids  s    V[[!r4   c                 (    | j                  d        y )Nc                  .    t        j                  d      S r@  )rp   net_io_countersr5   r4   r/   re   z?TestModuleFunctionsLeaks.test_net_io_counters.<locals>.<lambda>  s    V335Ar4   r   rD   s    r/   test_net_io_countersz-TestModuleFunctionsLeaks.test_net_io_counters  s     	ABr4   r   zneed root accessc                     t        j                  d       t               5  | j                  d        d d d        y # 1 sw Y   y xY w)Nr   r   c                  .    t        j                  d      S )Nr   rL  )rp   r   r5   r4   r/   re   z?TestModuleFunctionsLeaks.test_net_connections.<locals>.<lambda>  s    !7!7U!Cr4   )rp   r   r   rA   rD   s    r/   r   z-TestModuleFunctionsLeaks.test_net_connections  s1     	E*LLCD s	   =Ac                 n    t         rdn| j                  }| j                  t        j                  |       y )Ni @ )	tolerance)r	   rO  rA   rp   net_if_addrs)r*   rO  s     r/   test_net_if_addrsz*TestModuleFunctionsLeaks.test_net_if_addrs  s%    !(Idnn	V((I>r4   c                 B    | j                  t        j                         y r&   )rA   rp   net_if_statsrD   s    r/   test_net_if_statsz*TestModuleFunctionsLeaks.test_net_if_stats  s    V(()r4   c                 B    | j                  t        j                         y r&   )rA   rp   sensors_batteryrD   s    r/   test_sensors_batteryz-TestModuleFunctionsLeaks.test_sensors_battery  s     	V++,r4   c                 B    | j                  t        j                         y r&   )rA   rp   sensors_temperaturesrD   s    r/   test_sensors_temperaturesz2TestModuleFunctionsLeaks.test_sensors_temperatures  s     	V001r4   c                 B    | j                  t        j                         y r&   )rA   rp   sensors_fansrD   s    r/   test_sensors_fansz*TestModuleFunctionsLeaks.test_sensors_fans  s     	V(()r4   c                 B    | j                  t        j                         y r&   )rA   rp   	boot_timerD   s    r/   test_boot_timez'TestModuleFunctionsLeaks.test_boot_time  r  r4   c                 B    | j                  t        j                         y r&   )rA   rp   usersrD   s    r/   
test_usersz#TestModuleFunctionsLeaks.test_users  s    V\\"r4   c                 (    | j                  d        y )Nc                  ,    t        j                  d      S )NF)rp   
_set_debugr5   r4   r/   re   z9TestModuleFunctionsLeaks.test_set_debug.<locals>.<lambda>  s    V..u5r4   r   rD   s    r/   test_set_debugz'TestModuleFunctionsLeaks.test_set_debug  s    56r4   c                 B    | j                  t        j                         y r&   )rA   rt   winservice_enumeraterD   s    r/   test_win_service_iterz.TestModuleFunctionsLeaks.test_win_service_iter  s    LL223r4   c                      y r&   r5   rD   s    r/   test_win_service_getz-TestModuleFunctionsLeaks.test_win_service_get  s    r4   c                     t        t        j                               j                         | j	                  fd       y )Nc                  .    t         j                         S r&   )rt   winservice_query_configrC   s   r/   re   zFTestModuleFunctionsLeaks.test_win_service_get_config.<locals>.<lambda>      !=!=d!Cr4   nextrp   win_service_iterrC   rA   r*   rC   s    @r/   test_win_service_get_configz4TestModuleFunctionsLeaks.test_win_service_get_config  ,    //12779DLLCDr4   c                     t        t        j                               j                         | j	                  fd       y )Nc                  .    t         j                         S r&   )rt   winservice_query_statusrp  s   r/   re   zFTestModuleFunctionsLeaks.test_win_service_get_status.<locals>.<lambda>  rq  r4   rr  ru  s    @r/   test_win_service_get_statusz4TestModuleFunctionsLeaks.test_win_service_get_status  rw  r4   c                     t        t        j                               j                         | j	                  fd       y )Nc                  .    t         j                         S r&   )rt   winservice_query_descrrp  s   r/   re   zKTestModuleFunctionsLeaks.test_win_service_get_description.<locals>.<lambda>  s    !<!<T!Br4   rr  ru  s    @r/    test_win_service_get_descriptionz9TestModuleFunctionsLeaks.test_win_service_get_description  s,    //12779DLLBCr4   N)6r   r   r   r   r?   r6   r  r  r   r   r#  r   r   r   r   platformmachiner   r'  r	   r*  r-  r   r0  r5  r:  r   r=  r   rv   pathexistsrC  rF  r   rJ  getuidr   rQ  rT  r   rW  r   rZ  r   r]  r`  rc  rg  rj  rl  rv  r{  r  r5   r4   r/   r  r  S  s   0- = = > > ' ' < < ' ' [[/"(""$/8N   [[L(A& B & [[GN;( <(, [[&NO) P)JB [[	*CD- E- [[7bggnn%677D   D 	
D
 " "
 [[//HC I C [[2)"))+"2;MNE O E?
 [[	*CD* E*
 [[//H- I - [[44_M2 N 2 [[,,_E* F *
 ' '#7 	4		E	E	D% r4   r  )4r   
__future__r   r1   rv   r  rp   psutil._commonr   r   r   r   r   r	   psutil._compatr
   r   psutil.testsr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r    r!   _psplatformrt   r   rf   r)   r6   r8   r   r   r   r  r  r5   r4   r/   <module>r     s   &  	          -   ) % $ # ( , ) - # , ) 1 " ' ' # *  . ' ) " 6>>	8r:^ r:j3!7 3l K7LN L 8LZD~ ZDr4   