bghQTddlZddlZddlmZddlmZddlmZddlmZddlmZddlm Z ddlm Z dd lm Z dd lm Z dd lm Z dd lmZdd lmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddl m!Z!ddl"m#Z#ddl$m%Z%dd l&m'Z'dd!l&m(Z(dd"l)m*Z*er dd#l+m,Z,dd$l-m.Z.d%Z/ed&d'(Z0Gd)d'Z1d*e2d+ee1d,e fd-Z3e#Gd.d/e1Z4e#Gd0d1e1Z5Gd2d3eZ6d4ee5e4fd,eee2effd5Z7d6ee2efd,eee5e4ffd7Z8d4e1d,ee2effd8Z9d9ee2efd,ee2effd:Z:dS);N)StringIO)pprint)Any)cast)Dict)Iterable)Iterator)List)Mapping)NoReturn)Optional)Tuple)Type) TYPE_CHECKING)TypeVar)Union)ExceptionChainRepr) ExceptionInfo) ExceptionRepr) ReprEntry)ReprEntryNative)ReprExceptionInfoReprFileLocation) ReprFuncArgs) ReprLocals ReprTraceback) TerminalRepr)TerminalWriter)final)Config) Collector)Item)skip)Literal)CallInfoc |jS#t$rP|j}d|dddz}d|d|d||dx|_}|cYSwxYw)Nz%s.%s.%s version_infoz[{}] {} -- Python {} {}id sysplatform executable)_workerinfocacheAttributeError workerinfoformat)nodedverss `/builddir/build/BUILD/cloudlinux-venv-1.0.7/venv/lib/python3.11/site-packages/_pytest/reports.pygetworkerinfoliner7,s$$  O1^,RaR00$=$D$D dGQ}%sAlO% %   s AA#"A#_R BaseReport)boundceZdZUeeed<eeeeeefed<ede e eeeefee fed<e eeefed<eed<ded<d e d dfd Zerd ed e fd Zded dfdZded eeeeffdZed efdZed efdZed efdZed efdZed efdZed efdZed efdZed efdZed efdZed eefdZ de!fdZ"d e#ee ffdZ$e%de&e'd e#ee(fd e'fd!Z)dS)"r9whenlocationNlongreprsectionsnodeid&Literal['passed', 'failed', 'skipped']outcomekwreturnc :|j|dSN)__dict__update)selfrCs r6__init__zBaseReport.__init__Es R     keycdSrF)rIrLs r6 __getattr__zBaseReport.__getattr__Js CrKoutczt|dr+t|j}|r|||j}|dSt|dr,t t |}||dS t|}n#t$rd}YnwxYw||dS)Nr2 toterminalz) hasattrr7r2liner>rrrRstrUnicodeEncodeError)rIrP worker_infor>longrepr_terminalr5s r6rRzBaseReport.toterminalMs 4  &+DI66K &%%%=   F 8\ * *  $\8 < <   ( ( - - - - - -MM% - - -, - HHQKKKKKsB B#"B#prefixc#ZK|jD] \}}||r||fV!dSrF)r? startswith)rIrYnamecontents r6 get_sectionszBaseReport.get_sectionsasJ!] & &MD'v&& &go%%% & &rKct}t|}d|_|||}|S)zRead-only property that returns the full string representation of ``longrepr``. .. versionadded:: 3.0 F)rr hasmarkuprRgetvaluestrip)rIfiletwexcs r6 longreprtextzBaseReport.longreprtextfsNzz D ! !  mmooyy{{rKcfdd|dDS)z_Return captured log lines, if log capturing is enabled. .. versionadded:: 3.5  c3 K|] \}}|V dSrFrN.0rYr]s r6 z$BaseReport.caplog..zs7  )G      rKz Captured logjoinr^rIs r6caplogzBaseReport.caplogtsD yy  -1->->~-N-N      rKcfdd|dDS)zbReturn captured text from stdout, if capturing is enabled. .. versionadded:: 3.0 c3 K|] \}}|V dSrFrNrjs r6rlz'BaseReport.capstdout..7  )G      rKzCaptured stdoutrmros r6 capstdoutzBaseReport.capstdout~E ww  -1->->?P-Q-Q      rKcfdd|dDS)zbReturn captured text from stderr, if capturing is enabled. .. versionadded:: 3.0 rrc3 K|] \}}|V dSrFrNrjs r6rlz'BaseReport.capstderr..rtrKzCaptured stderrrmros r6 capstderrzBaseReport.capstderrrvrKc|jdkS)zWhether the outcome is passed.passedrBros r6r{zBaseReport.passed|x''rKc|jdkS)zWhether the outcome is failed.failedr|ros r6rzBaseReport.failedr}rKc|jdkS)zWhether the outcome is skipped.skippedr|ros r6rzBaseReport.skippeds|y((rKcB|jddS)z3The path portion of the reported node, as a string.z::r)r@splitros r6fspathzBaseReport.fspaths{  &&q))rKcdS)a6**Experimental** Whether this report should be counted towards the totals shown at the end of the test session: "1 passed, 1 failure, etc". .. note:: This function is considered **experimental**, so beware that it is subject to changes even in patch releases. TrNros r6count_towards_summaryz BaseReport.count_towards_summarys trKc.|j |j\}}}|SdS)a**Experimental** The head line shown with longrepr output for this report, more commonly during traceback representation during failures:: ________ Test.foo ________ In the example above, the head_line is "Test.foo". .. note:: This function is considered **experimental**, so beware that it is subject to changes even in patch releases. N)r=)rIrlinenodomains r6 head_linezBaseReport.head_lines$ = $%)] "FFFMtrKconfigcF|j||\}}}|S)N)reportr)hookpytest_report_teststatus)rIr _category_shortverboses r6_get_verbose_wordzBaseReport._get_verbose_words2%+[%I%I&J& & " 67rKc t|S)zReturn the contents of this report as a dict of builtin entries, suitable for serialization. This was originally the serialize_report() function from xdist (ca03269). Experimental method. )_report_to_jsonros r6_to_jsonzBaseReport._to_jsonst$$$rKcls reportdictc0t|}|di|S)aCreate either a TestReport or CollectReport, depending on the calling class. It is the callers responsibility to know which class to pass here. This was originally the serialize_report() function from xdist (ca03269). Experimental method. rN)_report_kwargs_from_json)rrkwargss r6 _from_jsonzBaseReport._from_jsons#**55s}}V}}rK)*__name__ __module__ __qualname__r rU__annotations__rintrr BaseExceptionrr rrJrrOr rRr r^propertyrfrpruryboolr{rrrrrr"rrr classmethodrr8objectrrNrKr6r9r9;sU 3-uS(3-456666 mM*E#sC-,@#|S5c?#### KKK 5555!S!T!!!! 3 3    n(&3&8E#s(O+D&&&&  c   X     X  3   X  3   X ((((X(((((X())))X)****X* t   X 8C=X( %$sCx.%%%% R d3;.? B   [   rK type_name report_classrDcBd}t}td|td|z|td|z|t||td|z|td|t|)Nz+https://github.com/pytest-dev/pytest/issueszd----------------------------------------------------------------------------------------------------)streamz.INTERNALERROR: Unknown entry type returned: %szreport_name: %szPlease report this bug at %s)rr RuntimeErrorra)rrrurlrs r6_report_unserialization_failurers 8C ZZF 9V$$$$ ;i GPVWWWW | +F;;;; :f%%%% )C /???? 9V$$$$ v(( ) ))rKc0eZdZdZdZ ddedeeeeefde ee fd d d e de e eeeefeefd d deeeefdedededeeeeefddfdZdefdZededdddfdZdS) TestReportzBasic test report object (also used for setup and teardown calls if they fail). Reports can contain arbitrary extra attributes. FrNrNr@r=keywordsrBrAr>r<z$Literal['setup', 'call', 'teardown']r?durationstartstopuser_propertiesrDc  ||_||_||_||_||_||_t | pg|_t ||_||_ | |_ | |_ |j | dSrF)r@r=rrBr>r<listrr?rrrrGrH) rIr@r=rrBr>r<r?rrrrextras r6rJzTestReport.__init__s$ 9A ,4  !   $O$9r:: X  ( "   U#####rKcdd|jj|j|j|jS)Nz <{} {!r} when={!r} outcome={!r}>)r1 __class__rr@r<rBros r6__repr__zTestReport.__repr__9s.188 N #T[$)T\   rKitemcallzCallInfo[None]c x|j}|dksJ|j}|j}|j}d|jD}|j}g} |jsd} d} n t |tsd} |} nt |jtj rd} | } | Jd|jj rC| dd\} }|Jtj| |d z| jf} nut#| j| j| jf} nSd} |jd kr||} n0|||jd d  } |jD]#\}}}| d|d||f$||j|j|| | || ||||j S)zCreate and fill a TestReport with standard item and call info. :param item: The item. :param call: The call info. collectci|]}|dS)rN)rkxs r6 z1TestReport.from_item_and_call..Ks000QAq000rKr{Nrrz=There should always be a traceback entry for skipping a test.rrtbstyleauto)stylez Captured  )r)r<rrrrexcinfo isinstancervaluer% Exception _getreprcrash_use_item_location reportinfoosrmessagerUpathr repr_failure_repr_failure_pyr getoption_report_sectionsappendr@r=r)rrrr<rrrrrr?rBr>rrrTrwhenrLr]s r6from_item_and_callzTestReport.from_item_and_call>syy    = y00$-000,| >FG Hg}55 ""GM4>:: #))++MMR"MM=3B!%!2!22A2!6JD$+++!yq!)CHH #AF QXqyAHH"9&&#0099HH#44t{'<'.serialize_repr_entrysr!%((**,, 6 6JCuj)) 6'.u55S "5kk2DAA rK reprtracebackc\tj|}fd|jD|d<|S)Nc&g|] }|SrNrN)rkrrs r6 zE_report_to_json..serialize_repr_traceback..s2! ! ! ()  # #! ! ! rK reprentries)rrr)rrrs r6serialize_repr_tracebackz1_report_to_json..serialize_repr_tracebacksJ#M22! ! ! ! -:-F! ! ! } rK reprcrashc2|tj|SdSrF)rr)rs r6serialize_repr_crashz-_report_to_json..serialize_repr_crashs   %i00 04rKrepcX|jJtt|j}|j|j|jd}t |trDg|d<|jD]6\}}}|d |||f7nd|d<|S)N)rrr?chain) r>rrrrr?rrrr)rr>rrepr_traceback repr_crash descriptionrrs r6serialize_exception_longreprz5_report_to_json..serialize_exception_longreprs|''' s|44--h.@AA55h6LMM )" "  h 2 3 3 # F7O;C>  7 Kw&&00@@,,Z88# #F7O rKrRr>rN)rrrrrUrrr rr9rGcopyrSr>rrPathLiker)rrr3r\rrrs @@@r6rrsY/0 c3h $sCx.,- $sCx. !*c3h. Av --( 6?O 4 4 1 O[: :  198@@AjMM00AjMM*  agr{ + + i$((AdGG X  AdG HrKrc" fd fd}dttttffd}drddvrddvr|dd}|dd}ddrQg}ddD]0\}}}||||||f1t |} nt || } dd D] } | j|  | d<S) zReturn **kwargs that can be used to construct a TestReport or CollectReport instance. This was originally the serialize_report() function from xdist (ca03269). c|d}|d}|dkr~d}d}d}|drtd i|d}|drtd i|d}|drt|dd}t|d||||d }n2|d krt |d}nt |t |S) Nrrr reprfuncargs reprfileloc reprlocalslinesr)rr rrrrrN)rrrrrrr)rr entry_typer rr reprentryrs r6deserialize_repr_entryz8_report_kwargs_from_json..deserialize_repr_entry%s&!'  $ $LKJN# D+CCd>.BCC M" F.EEm1DEE L! E'\(:7(CDD ;D7m)%'7m <<<II, , ,'W 66II +J J O O OrKcJfd|dD|d<tdi|S)Nc&g|] }|SrNrN)rkrrs r6rzP_report_kwargs_from_json..deserialize_repr_traceback..As2. . . *+ " "1 % %. . . rKrrNr)repr_traceback_dictrs r6deserialize_repr_tracebackz<_report_kwargs_from_json..deserialize_repr_traceback@sM. . . . /B=/Q. . . M*332333rKrepr_crash_dictc"| tdi|SdS)NrNr)rs r6deserialize_repr_crashz8_report_kwargs_from_json..deserialize_repr_crashFs!  &#66o66 64rKr>rrr)rrr?)r rrUrrrr addsection) rrrrrrrepr_traceback_datarepr_crash_datarexception_infosectionrs ` @r6rrs644444 c3h0H : 0 :j1 1 1 z*5 5 522 z "? 3  +*:j+A++NOO j !' * EEOFF  A#_k 223FGG..??##5)) N/+#N "*-j9 0 0G %N %w / / /!/ : rK);rriorrtypingrrrrr r r r r rrrrr_pytest._code.coderrrrrrrrrrr _pytest._ior _pytest.compatr!_pytest.configr" _pytest.nodesr#r$_pytest.outcomesr%typing_extensionsr&_pytest.runnerr'r7r8r9rUrrrrrrrrrNrKr6r*s  111111,,,,,,,,,,,,((((((......000000//////++++++)))))),,,,,,++++++&&&&&& !!!!!!######!!!!!!())))))''''''    WT&&&ggggggggT * *"&z"2 *  * * * *I I I I I I I I X0 0 0 0 0 J0 0 0 f*****|*** -+ , d38n  sCx.  eM:-./    F JF 4S>F F F F RPc3hPDcNPPPPPPrK