5ߞ 3n-TSSKrSSKrSSKrSSKr"SS\R5r"SS5r"SS\5r"SS \R5r"S S \5r "S S \5r Sr Sr \ "\ 5r SSjrSr"SS\R5r\S:Xa\R$"5 gg)Nc,\rSrSrSrSrSrSrSrg)TestGetProfilec0[R"S5 gNsys setprofileselfs ?/opt/alt/python313/lib64/python3.13/test/test_sys_setprofile.pysetUpTestGetProfile.setUp tc0[R"S5 grrr s r tearDownTestGetProfile.tearDown rrcLUR[R"55 gr) assertIsNoner getprofiler s r test_emptyTestGetProfile.test_emptys #..*+rcSn[R"U5 UR[R"5U5 g)Ncgrargss r fn&TestGetProfile.test_setget..fn r)r r assertIsr)r rs r test_setgetTestGetProfile.test_setgets*  r cnn&+rrN) __name__ __module__ __qualname____firstlineno__rrrr#__static_attributes__rrr rrs,,rrc0\rSrSrSrSrSSjrSrSrg) HookWatcherc /Ul/Ulgr)frameseventsr s r __init__HookWatcher.__init__s  rcNUS:Xd US:XdUS:XaURX!U5 gg)Ncallreturn exception add_eventr frameeventargs r callbackHookWatcher.callbacks, VO  # NN5 -$rNc<Uc[R"S5nURRU5nURR XA[U5U45 g![a3 [ UR5nURR U5 Ndf=f)zAdd an event to the log.N) r _getframer.index ValueErrorlenappendr/ident)r r:r9r;framenos r r7HookWatcher.add_event#s~ =MM!$E &kk''.G GE%L#>?  &$++&G KK  u % &sA:BBc[URR5[[5/nSUlURVs/sHo"SU;dM UPM sn$s snf)zRemove calls to add_event().N)rEr7__func__r.r/)r disalloweditems r get_eventsHookWatcher.get_events0sKDNN334eElC  !%JQz0IJJJs  AA)r/r.)NN) r%r&r'r(r0r<r7rMr)rrr r+r+s. @Krr+cJ\rSrSrSrSrSrSrSrSr \\\\ \ \ S.r S r g ) ProfileSimulator8cHXl/Ul[RU5 gr)testcasestackr+r0)r rSs r r0ProfileSimulator.__init__9s  T"rc.URU"X5 gr)dispatchr8s r r<ProfileSimulator.callback>s eT)rc^URSU5 URRU5 g)Nr3)r7rTrDr r9s r trace_callProfileSimulator.trace_callBs" vu% % rc\URSU5 URR5 g)Nr4)r7rTpoprZs r trace_returnProfileSimulator.trace_returnFs x' rc:URRS5 g)Nz2the profiler should never receive exception events)rSfailrZs r trace_exception ProfileSimulator.trace_exceptionJs  @ BrcgrrrZs r trace_passProfileSimulator.trace_passNs r)r3r5r4c_callc_return c_exception)rTrSN) r%r&r'r(r0r<r[r_rcrfrWr)rrr rPrP8s<# *!B $!  HrrPc\rSrSrSSjrSrg) TestCaseBase[c [XR55nU(aHXB:waBURS[R"U5<S[R"U5<35 ggUVVVVs/sH upVpxXVU4PM snnnnU:waBURS[R"U5<S[R"U5<35 ggs snnnnf)NzExpected events: z Received events: )capture_events new_watcherrbpprintpformat) r callableexpected check_argsr/rFr:rEr;s r check_eventsTestCaseBase.check_events\s*:*:*<= ! #^^H5v~~f7MOP"KQQ&,FGE'&QU]] #^^H5v~~f7MOP^Qs0C rN)F)r%r&r'r(rvr)rrr rlrl[s Prrlcn\rSrSrSrSrSrSrSrSr Sr S r S r S r S rS rSrSrSrSrg)ProfileHookTestCasehc[5$r)r+r s r rpProfileHookTestCase.new_watcheris }rcTSn[U5nURUSSU4SSU4/5 g)Ncgrrps r f*ProfileHookTestCase.test_simple..fmr!rr?r3r4rErvr rf_idents r test_simpleProfileHookTestCase.test_simplel8 ( !q&'2 (G4  !rcTSn[U5nURUSSU4SSU4/5 g)NcSS- gNr?rrrs r r-ProfileHookTestCase.test_exception..fu aCrr?r3r4rrs r test_exception"ProfileHookTestCase.test_exceptiont8 ( !q&'2 (G4  !rcTSn[U5nURUSSU4SSU4/5 g)NcSS- g! g=frrrs r r4ProfileHookTestCase.test_caught_exception..f}1 D r?r3r4rrs r test_caught_exception)ProfileHookTestCase.test_caught_exception|: ( !q&'2 (G4  !rcTSn[U5nURUSSU4SSU4/5 g)NcSS- g! g=frrrs r r;ProfileHookTestCase.test_caught_nested_exception..frrr?r3r4rrs r test_caught_nested_exception0ProfileHookTestCase.test_caught_nested_exceptionrrcTSn[U5nURUSSU4SSU4/5 g)NcSS- grrrs r r4ProfileHookTestCase.test_nested_exception..frrr?r3r4rrs r test_nested_exception)ProfileHookTestCase.test_nested_exceptions: ( !q&'2 !(G4   !rc ^SmU4Sjn[T5n[U5nURUSSU4SSU4SSU4SSU4SSU4SSU4/5 g)NcSS- grrrs r r>ProfileHookTestCase.test_exception_in_except_clause..frrcF>T"U5 g! T"U5 g! g=f=frrrrs r g>ProfileHookTestCase.test_exception_in_except_clause..gs# ! qTs    r?r3rIr4rr rrg_identrs @r test_exception_in_except_clause3ProfileHookTestCase.test_exception_in_except_clausesq   (( !q&'2 &'2 (G4 &'2 (G4 (G4   !rc ^SmU4Sjn[T5n[U5nURUSSU4SSU4SSU4SSU4SSU4/5 g)NcSS- grrrs r r9ProfileHookTestCase.test_exception_propagation..frrcd>T"U5 URS5 g!URS5 f=f)Nfalling throughr6rs r r9ProfileHookTestCase.test_exception_propagation..gs%1[[!23Q[[!23s/r?r3rIr4rrrs @r test_exception_propagation.ProfileHookTestCase.test_exception_propagationsh  4(( !q&'2 &'2 (G4 "3W= (G4   !rcTSn[U5nURUSSU4SSU4/5 g)Nc&SS- g! SS- g=frrrs r r/ProfileHookTestCase.test_raise_twice..fs1 AaCsr?r3r4rrs r test_raise_twice$ProfileHookTestCase.test_raise_twices: ( !q&'2 (G4  !rcTSn[U5nURUSSU4SSU4/5 g)NcSS- g! e=frrrs r r1ProfileHookTestCase.test_raise_reraise..fs1 Es r?r3r4rrs r test_raise_reraise&ProfileHookTestCase.test_raise_reraises: ( !q&'2 (G4  !rcTSn[U5nURUSSU4SSU4/5 g)Nc[5er) Exceptionrs r r)ProfileHookTestCase.test_raise..fs + rr?r3r4rrs r test_raiseProfileHookTestCase.test_raises8 ( !q&'2 (G4  !rc$^^^ ^ SmU4SjmU4Sjm U 4Sjm U 4Sjn[T5n[T5n[T 5n[T 5n[U5nURUSSU4SSU4S SU4S SU4S SU4S S U4S S U4S S U4SS U4SS U4/ 5 g) NcSS- grrrrr r5ProfileHookTestCase.test_distant_exception..frrc>T"5 grrrsr r5ProfileHookTestCase.test_distant_exception..g Crc>T"5 grrrsr h5ProfileHookTestCase.test_distant_exception..hrrc>T"5 grrrsr i5ProfileHookTestCase.test_distant_exception..irrc>T"5 grrrrs r j5ProfileHookTestCase.test_distant_exception..jrrr?r3rIrr4r r rrrh_identi_identj_identrrrrs @@@@r test_distant_exception*ProfileHookTestCase.test_distant_exception     ((((( !q&'2 &'2 &'2 &'2 &'2 (G4 (G4 (G4 (G4 (G4  !rc ^SmU4Sjn[T5n[U5nURUSSU4SSU4SSU4SSU4SSU4SSU4SSU4SSU4/5 g)Nc38# [S5HnUv M g7fNrIrangers r r-ProfileHookTestCase.test_generator..f1Xc">T"5HnM grrrrrs r r-ProfileHookTestCase.test_generator..gSrr?r3rIr4rrs @r test_generator"ProfileHookTestCase.test_generators  (( !q&'2 &'2 (G4 &'2 (G4 !&'2 (G4 (G4  !rc ^SmU4Sjn[T5n[U5nURUSSUS4SSUS4SSUS4SSUS4/SS 9 g) Nc38# [S5HnUv M g7frrrs r r8ProfileHookTestCase.test_unfinished_generator..frrc&>[T"55 gr)nextrs r r8ProfileHookTestCase.test_unfinished_generator..g s Irr?r3rIr4rT)rurrs @r test_unfinished_generator-ProfileHookTestCase.test_unfinished_generatorso  (( !q&'48 &'48 (GQ7 (GT: -1  2rc ^SmU4Sjn[T5n[U5nURUSSU4SSU4SSU4SSU4SSU4SSU4SSU4SSU4/5 g)Nc38# [S5HnUv M g7frrrs r r2ProfileHookTestCase.test_stop_iteration..frrc">T"5HnM grrrs r r2ProfileHookTestCase.test_stop_iteration..grrr?r3rIr4rrs @r test_stop_iteration'ProfileHookTestCase.test_stop_iterations  (( !q&'2 &'2 (G4 &'2 (G4 &'2 (G4 (G4  !rrN)r%r&r'r(rprrrrrrrrrrrrrrr)rrr ryryhsM!!!! !!& !!!!!8!, 2!rrycP\rSrSrSrSrSrSrSrSr Sr S r S r S r S rg )ProfileSimulatorTestCasei,c[U5$r)rPr s r rp$ProfileSimulatorTestCase.new_watcher-s %%rcTSn[U5nURUSSU4SSU4/5 g)Ncgrrrs r r/ProfileSimulatorTestCase.test_simple..f1r!rr?r3r4rrs r r$ProfileSimulatorTestCase.test_simple0rrcTSn[U5nURUSSU4SSU4/5 g)NcSS- grrrs r r8ProfileSimulatorTestCase.test_basic_exception..f9rrr?r3r4rrs r test_basic_exception-ProfileSimulatorTestCase.test_basic_exception8rrcTSn[U5nURUSSU4SSU4/5 g)NcSS- g! g=frrrs r r9ProfileSimulatorTestCase.test_caught_exception..fArrr?r3r4rrs r r.ProfileSimulatorTestCase.test_caught_exception@rrc$^^^ ^ SmU4SjmU4Sjm U 4Sjm U 4Sjn[T5n[T5n[T 5n[T 5n[U5nURUSSU4SSU4S SU4S SU4S SU4S S U4S S U4S S U4SS U4SS U4/ 5 g) NcSS- grrrrr r:ProfileSimulatorTestCase.test_distant_exception..fJrrc>T"5 grrrsr r:ProfileSimulatorTestCase.test_distant_exception..gLrrc>T"5 grrrsr r:ProfileSimulatorTestCase.test_distant_exception..hNrrc>T"5 grrrsr r:ProfileSimulatorTestCase.test_distant_exception..iPrrc>T"5 grrrs r r:ProfileSimulatorTestCase.test_distant_exception..jRrrr?r3rIrrrr4rrs @@@@r r/ProfileSimulatorTestCase.test_distant_exceptionIrrc`^0mU4Sjn[U5nURUSSU4SSU4/5 g)Nc6>[R"0S40TD6 gN*dictgetrkwargss r r7ProfileSimulatorTestCase.test_unbound_method..fhs HHR &v &rr?r3r4rr rrr&s @r test_unbound_method,ProfileSimulatorTestCase.test_unbound_methodfs> '( !q&'2 (G46 7rcTSn[U5nURUSSU4SSU4/5 g)Nc,[R5 grr"rs r r?ProfileSimulatorTestCase.test_unbound_method_no_args..fps HHJrr?r3r4rrs r test_unbound_method_no_args4ProfileSimulatorTestCase.test_unbound_method_no_argsos8 ( !q&'2 (G46 7rcTSn[U5nURUSSU4SSU4/5 g)Nc8[R[S5 gr r#r$printrs r rDProfileSimulatorTestCase.test_unbound_method_invalid_args..fxs HHUB rr?r3r4rrs r test_unbound_method_invalid_args9ProfileSimulatorTestCase.test_unbound_method_invalid_argsws8 ( !q&'2 (G46 7rc`^0mU4Sjn[U5nURUSSU4SSU4/5 g)Nc2>[R"S0TD6 g)Nrr"r%s r rGProfileSimulatorTestCase.test_unbound_method_no_keyword_args..fs HH v rr?r3r4rr(s @r #test_unbound_method_no_keyword_args ( !q&'2 (G46 7rc`^0mU4Sjn[U5nURUSSU4SSU4/5 g)Nc>>[R"[S40TD6 gr r2r%s r rLProfileSimulatorTestCase.test_unbound_method_invalid_keyword_args..fs HHUB )& )rr?r3r4rr(s @r (test_unbound_method_invalid_keyword_argsAProfileSimulatorTestCase.test_unbound_method_invalid_keyword_argss> *( !q&'2 (G46 7rrN)r%r&r'r(rprr rrr)r.r5r:r?r)rrr rr,s4&!!!!:77777rrc[US5(a URnO URnURUR4$)Nf_code)hasattrrB__code__co_firstlinenoco_name)functioncodes r rErEs8x""      ,,rc"U"U5 g! g=frr)rrs r protectrJs 1Ds cUc [5n[R"5n[R"5 [R "UR 5 [X5 [R "S5 U(a[R"5 UR5SS$!U(a[R"5 ff=f)Nr?) r+gc isenableddisabler r r<rJenablerM)rsrold_gcs r rorosy M\\^FJJL qzz" t  IIK <<>!B   IIK s AB))CcBSSKnUR"[U55 g)Nr)rqro)rsrqs r show_eventsrSs MM.*+rc2\rSrSrSrSrSrSrSrSr g) TestEdgeCasesicUR[R[R"55 [R"S5 gr) addCleanupr r rr s r rTestEdgeCases.setUps' (89 trc^SnSm"U4SjS5n[R"U"55 [R"U5 UR[R"5T5 g)Ncgrrrs r foo*TestEdgeCases.test_reentrancy..foo rcgrrrs r bar*TestEdgeCases.test_reentrancy..barr]rc(>\rSrSrSrU4SjrSrg)(TestEdgeCases.test_reentrancy..Aicgrr)r rs r __call__1TestEdgeCases.test_reentrancy..A.__call__src2>[R"T5 grr)r r_s r __del__0TestEdgeCases.test_reentrancy..A.__del__ss#rrN)r%r&r'r(rdrgr))r_sr Arbs  $ $rri)r r assertEqualr)r r[rir_s @r test_reentrancyTestEdgeCases.test_reentrancysJ   $ $ qs s )3/rcSn[R"U5 A[R"[R"55 g)Ncgrrrs r r[+TestEdgeCases.test_same_object..foor]r)r r r)r r[s r test_same_objectTestEdgeCases.test_same_objects+  s  s~~'(rc SnS[R"5l[R"5n[R"S5 U"5 [R"U5 [R "S5 U"5 g)Ncgrrrrr r9TestEdgeCases.test_profile_after_trace_opcodes..fr]rTcgrrrs r @TestEdgeCases.test_profile_after_trace_opcodes..s4rcgrrrs r rvrwsTr)r r@f_trace_opcodesgettracesettracer )r r prev_traces r test_profile_after_trace_opcodes.TestEdgeCases.test_profile_after_trace_opcodessR +/ '\\^  '(  Z  )* rc^"SS5n/m[R"U4Sj5 U"5R5 [R"S5 URT/SQ5 g)Nc$\rSrSr\"\5rSrg)4TestEdgeCases.test_method_with_c_function..AirN)r%r&r'r( classmethodreprrr)rrr rirs D!Arric&>TRU5$r)rD)r9r:rr/s r rv;TestEdgeCases.test_method_with_c_function..s&--2Fr)rhrirh)r r rrj)r rir/s @r test_method_with_c_function)TestEdgeCases.test_method_with_c_functionsG  " " FG  t !ABrrN) r%r&r'r(rrkrpr}rr)rrr rUrUs0$)   CrrU__main__r)rMrqr unittestTestCaserr+rPrlryrrErJ protect_identrorSrUr%mainrrr rs ,X&&,"KK@  {  F P8$$ PA!,A!Hb7|b7J-g  ", 8CH%%8Cv z MMOr