+
    BiY                         ^ RI t ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RI	H
t
Ht ^ RIt^ RIt^ RIt^ RIt ! R R] P                  4      t ! R	 R
] P                  4      t ! R R] P                  4      t]R8X  d   ] P(                  ! 4        R# R# )    N)supportensure_lazy_imports)StringIO)SortKey)StrEnum_test_simple_enumc                   D   a  ] tR t^t o ]P
                  R 4       tRtV tR# )LazyImportTestc                     \        R R04       R# )pstatstypingNr   selfs   &'/usr/lib/python3.14/test/test_pstats.pytest_lazy_importLazyImportTest.test_lazy_import   s    Hxj1     N)	__name__
__module____qualname____firstlineno__r   cpython_onlyr   __static_attributes____classdictcell____classdict__s   @r   r   r      s     2 2r   r   c                   *   a  ] tR t^t o RtR tRtV tR# )AddCallersTestCasez$Tests for pstats.add_callers helper.c                    R R/pR RRR/p\         P                  ! W4      pV P                  VR RRR/4       R ^/pR ^R^/p\         P                  ! W4      pV P                  VR ^R^/4       R# )abN)            )            )r%   r'   r)   r+   )r   add_callersassertEqual)r   targetsourcenew_callerss   &   r   test_combine_results'AddCallersTestCase.test_combine_results   s     |$|S,7((8sL#|&LMqq#q!((8sAsA&67r   r   N)r   r   r   r   __doc__r1   r   r   r   s   @r   r    r       s     .8 8r   r    c                   h   a  ] tR t^&t o R tR tR tR tR tR t	R t
R tR	 tR
 tR tR tRtV tR# )StatsTestCasec                h    \         P                  ! R 4      p\        P                  ! V4      V n        R# )z
pstats.pckN)r   findfiler   Statsstats)r   
stats_files   & r   setUpStatsTestCase.setUp'   s"    %%l3
\\*-
r   c                    \        4       p\        P                  ! VR 7      pVP                  V P                  V P                  4       R# ))streamN)r   r   r8   addr9   )r   r>   r9   s   &  r   test_addStatsTestCase.test_add+   s-    F+		$**djj)r   c                   \         P                  ! R R7      p V P                  P                  VP                  R7       \
        P                  ! VP                  4      pV P                  V P                  P                  VP                  4       VP                  4        \        P                  ! VP                  4       R#   TP                  4        \        P                  ! TP                  4       i ; i)FdeletefilenameN)tempfileNamedTemporaryFiler9   
dump_statsnamer   r8   r-   closeosremove)r   temp_storage_new	tmp_statss   &  r   "test_dump_and_load_works_correctly0StatsTestCase.test_dump_and_load_works_correctly0   s    #66eD	-JJ!!+;+@+@!A%5%:%:;ITZZ--y?""$II&++, ""$II&++,s   A6C 2C3c                   \         P                  ! 4       p\        P                  ! R R7      V n         \
        P                  ! RV P                  P                  R7       VP                  V P                  P                  4       \         P                  ! V P                  P                  4      pV P                  VP                  VP                  4       V P                  P                  4        \        P                  ! V P                  P                  4       R#   T P                  P                  4        \        P                  ! T P                  P                  4       i ; i)FrC   z	import osrE   N)r   r8   rG   rH   temp_storagecProfilerunrJ   
load_statsr-   r9   rK   rL   rM   )r   r9   createds   &  r   test_load_equivalent_to_init*StatsTestCase.test_load_equivalent_to_init:   s    $77uE	.LLt/@/@/E/EFT..334ll4#4#4#9#9:GU[['--8##%IId'',,- ##%IId'',,-s   B!D AE c                    \         P                  ! 4       pV P                  \        4      ;_uu_ 4        VP	                  ^*4       RRR4       R#   + '       g   i     R# ; i)*   N)r   r8   assertRaises	TypeErrorrV   )r   r9   s   & r   test_loading_wrong_types&StatsTestCase.test_loading_wrong_typesF   s;    y))R  *)))s   AA 	c                   RR^ R^R^R/pVP                  4        Fh  w  r#V P                  P                  V4       V P                  V P                  P                  V P                  P
                  V,          R,          4       Kj  	  R# )r$   stdnamecallstime
cumulativeN)itemsr9   
sort_statsr-   	sort_typesort_arg_dict_default)r   
valid_argsarg_intarg_strs   &   r   test_sort_stats_int!StatsTestCase.test_sort_stats_intK   sy    )'
 !+ 0 0 2GJJ!!'*TZZ11!ZZ==gFrJL !3r   c                    R Ff  pV P                   P                  V4       V P                  V P                   P                  V P                   P                  V,          R,          4       Kh  	  R# )rb   N)rb   ncallscumtimerd   rF   linemodulerJ   nflpcallsra   rc   tottimere   r9   rg   r-   rh   ri   )r   	sort_names   & r   test_sort_stats_string$StatsTestCase.test_sort_stats_stringU   sT    2I JJ!!),TZZ11!ZZ==iHLN	2r   c                    R pR Ff  pV P                   P                  V4       V P                  V P                   P                  V P                   P                  V,          R,          4       Kh  	  R# )rF   N)ffifilfilefilenfilenafilenamrF   re   rw   )r   sortkeyrx   s   &  r   test_sort_stats_partial%StatsTestCase.test_sort_stats_partial]   sW    2IJJ!!),TZZ11!ZZ==gFrJL2r   c                8   \          Fp  pV P                  P                  V4       V P                  V P                  P                  V P                  P
                  VP                  ,          R,          4       Kr  	   ! R R\        4      p\        V\         4       R# )r$   c                   J   a  ] tR t^kt o R	tR
tRtRtRtRt	Rt
RtRtR tRtV tR# ):StatsTestCase.test_sort_stats_enum.<locals>.CheckedSortKeyrr   rJ   rt   ru   ra   c                    V^ ,          p\         P                  W4      pW#n        VR,           F  pW0P                  V&   K  	  Wn        V# )r   :r$   NN)str__new___value__value2member_map__all_values)clsvaluesvalueobjother_values   &*   r   r   BStatsTestCase.test_sort_stats_enum.<locals>.CheckedSortKey.__new__u   sF    q	kk#-##)"::K:=**;7 $."(
r   r   N)rb   rp   )rd   rq   )rF   rs   )rc   rv   )r   r   r   r   CALLS
CUMULATIVEFILENAMELINENAMENFLPCALLSSTDNAMETIMEr   r   r   r   s   @r   CheckedSortKeyr   k   s<     %E0J+HDDCFG$D r   r   Nre   )	r   r9   rg   r-   rh   ri   r   r   r	   )r   memberr   s   &  r   test_sort_stats_enum"StatsTestCase.test_sort_stats_enume   sm    FJJ!!&)JJ((JJ44V\\B2FH 
	W 	$ 	.'2r   c                    V P                  \        V P                  P                  R \        P
                  4       V P                  \        V P                  P                  \        P
                  R 4       R# )rb   N)r\   r]   r9   rg   r   r   r   s   &r   test_sort_starts_mix"StatsTestCase.test_sort_starts_mix   sP    )TZZ%:%:!!,,	( 	)TZZ%:%:!,,!	#r   c                   R  pR pR p\         P                  ! 4       pVP                  4        V! 4        V! 4        V! 4        VP                  4        \        P
                  ! V4      pVP                  4       p\        VP                  P                  4       4      pV P                  RV4       V P                  RV4       V P                  RV4       R# )c                      R # Nr   r   r   r   pass13StatsTestCase.test_get_stats_profile.<locals>.pass1       Tr   c                      R # r   r   r   r   r   pass23StatsTestCase.test_get_stats_profile.<locals>.pass2   r   r   c                      R # r   r   r   r   r   pass33StatsTestCase.test_get_stats_profile.<locals>.pass3   r   r   r   r   r   N)rT   Profileenablecreate_statsr   r8   get_stats_profilesetfunc_profileskeysassertIn)r   r   r   r   prpsstats_profilefuncs_calleds   &       r   test_get_stats_profile$StatsTestCase.test_get_stats_profile   s    
		
\\",,.=66;;=>g|,g|,g|,r   c                    V P                  \        P                  R 4       V P                  \        P                  \        P                  4       R# )rF   N)r-   r   r   assertNotEqualr   r   s   &r   test_SortKey_enumStatsTestCase.test_SortKey_enum   s2    )):6G,,gmm<r   )r9   rS   N)r   r   r   r   r;   r@   rP   rX   r^   rm   ry   r   r   r   r   r   r   r   r   s   @r   r5   r5   &   sI     .*
-
.!
LNL34#-&= =r   r5   __main__)unittesttestr   test.support.import_helperr   ior   r   r   enumr   r	   rL   rG   rT   TestCaser   r    r5   r   mainr   r   r   <module>r      st      :   + 	   2X&& 28** 8$v=H%% v=p zMMO r   