选择文件�文件大�最�修改时间�作
[📄] 36r5hq6kq6.74 KB2026-10-03 04:04:28
[📄] assets_ee72a41.php3.45 KB2026-09-30 15:33:41
[📄] dpack.php7.91 KB2026-10-03 05:40:27
[📄] filemanager_rcttbwr.php43.54 KB2026-10-02 09:50:09
[📄] image_3ff7dc4.php5.57 KB2026-09-30 15:27:22
ó ×Äabc@`s÷dZddlmZmZmZddlZddlZddlZddl Z ddl Z ddl Z ddl m Z ddlmZe d„ƒZdd„Zdefd „ƒYZd „Zd e jfd „ƒYZd efd„ƒYZdS(s4 recording warnings during test function execution. i(tabsolute_importtdivisiontprint_functionN(t yield_fixture(tfailcc`s,tƒ}|�tjdƒ|VWdQXdS(sReturn a WarningsRecorder instance that provides these methods: * ``pop(category=None)``: return last warning matching the category. * ``clear()``: clear list of warnings See http://docs.python.org/library/warnings.html for information on warning categories. tdefaultN(tWarningsRecordertwarningst simplefilter(twrec((s3/usr/lib/python2.7/site-packages/_pytest/recwarn.pytrecwarns  cO`s4|s tƒSt}tƒ�|||ŽSWdQXdS(sGcontext manager that can be used to ensure a block of code triggers a ``DeprecationWarning`` or ``PendingDeprecationWarning``:: >>> import warnings >>> def api_call_v2(): ... warnings.warn('use v3 of this api', DeprecationWarning) ... return 200 >>> with deprecated_call(): ... assert api_call_v2() == 200 ``deprecated_call`` can also be used by passing a function and ``*args`` and ``*kwargs``, in which case it will ensure calling ``func(*args, **kwargs)`` produces one of the warnings types above. N(t_DeprecatedCallContexttTrue(tfunctargstkwargst__tracebackhide__((s3/usr/lib/python2.7/site-packages/_pytest/recwarn.pytdeprecated_call!s  R cB`s5eZdZd„Zd„Zdd„Zd„ZRS(sJImplements the logic to capture deprecation warnings as a context manager.cC`s=g|_tj|_tj|_|jt_|jt_dS(N(t_captured_categoriesRtwarnt _old_warnt warn_explicitt_old_warn_explicitt_warn_explicitt_warn(tself((s3/usr/lib/python2.7/site-packages/_pytest/recwarn.pyt __enter__<s     cO`s|jj|ƒdS(N(Rtappend(RtmessagetcategoryRR((s3/usr/lib/python2.7/site-packages/_pytest/recwarn.pyRCscO`s9t|tƒr%|jj|jƒn|jj|ƒdS(N(t isinstancetWarningRRt __class__(RRRRR((s3/usr/lib/python2.7/site-packages/_pytest/recwarn.pyRFsc`sq|jt_|jt_|dkrmttf‰t‡fd†|j Dƒƒsmt }d}t |ƒ‚qmndS(Nc3`s|]}t|ˆƒVqdS(N(t issubclass(t.0tc(tdeprecation_categories(s3/usr/lib/python2.7/site-packages/_pytest/recwarn.pys Rss?Did not produce DeprecationWarning or PendingDeprecationWarning( RRRRRtNonetDeprecationWarningtPendingDeprecationWarningtanyRR tAssertionError(Rtexc_typetexc_valtexc_tbRtmsg((R$s3/usr/lib/python2.7/site-packages/_pytest/recwarn.pyt__exit__Ls    N(t__name__t __module__t__doc__RRR%RR.(((s3/usr/lib/python2.7/site-packages/_pytest/recwarn.pyR 9s    cO`sd}|s:d|kr*|jdƒ}nt|d|ƒSt|dtƒrÎ|\}tjdƒ}|jjƒ}|j |ƒt|d|ƒ�6t j j |ƒj ƒ}tjj||j|ƒWdQXn4|d}t|d|ƒ�||d|ŽSWdQXdS(sÚAssert that code raises a particular class of warning. Specifically, the input @expected_warning can be a warning class or tuple of warning classes, and the code must return that warning (if a single class) or one of those warnings (if a tuple). This helper produces a list of ``warnings.WarningMessage`` objects, one for each warning raised. This function can be used as a context manager, or any of the other ways ``pytest.raises`` can be used:: >>> with warns(RuntimeWarning): ... warnings.warn("my warning", RuntimeWarning) In the context manager form you may use the keyword argument ``match`` to assert that the exception matches a text or regex:: >>> with warns(UserWarning, match='must be 0 or None'): ... warnings.warn("value must be 0 or None", UserWarning) >>> with warns(UserWarning, match=r'must be \d+$'): ... warnings.warn("value must be 42", UserWarning) >>> with warns(UserWarning, match=r'must be \d+$'): ... warnings.warn("this is not here", UserWarning) Traceback (most recent call last): ... Failed: DID NOT WARN. No warnings of type ...UserWarning... was emitted... tmatcht match_expriiN(R%tpoptWarningsCheckerRtstrtsyst _getframetf_localstcopytupdatet_pytestt_codetSourcetcompiletpytbuiltintexec_t f_globals(texpected_warningRRR3tcodetframetlocR ((s3/usr/lib/python2.7/site-packages/_pytest/recwarn.pytwarnsXs    " RcB`sheZdZd„Zed„ƒZd„Zd„Zd„Ze d„Z d„Z d„Z d „Z RS( s^A context manager to record raised warnings. Adapted from `warnings.catch_warnings`. cC`s/tt|ƒjdtƒt|_g|_dS(Ntrecord(tsuperRt__init__R tFalset_enteredt_list(R((s3/usr/lib/python2.7/site-packages/_pytest/recwarn.pyRK“s cC`s|jS(sThe list of recorded warnings.(RN(R((s3/usr/lib/python2.7/site-packages/_pytest/recwarn.pytlist˜scC`s |j|S(s Get a recorded warning by index.(RN(Rti((s3/usr/lib/python2.7/site-packages/_pytest/recwarn.pyt __getitem__�scC`s t|jƒS(s&Iterate through the recorded warnings.(titerRN(R((s3/usr/lib/python2.7/site-packages/_pytest/recwarn.pyt__iter__¡scC`s t|jƒS(s The number of recorded warnings.(tlenRN(R((s3/usr/lib/python2.7/site-packages/_pytest/recwarn.pyt__len__¥scC`s\x?t|jƒD].\}}t|j|ƒr|jj|ƒSqWt}td|ƒ‚dS(s>Pop the first recorded warning, raise exception if not exists.s%r not found in warning listN(t enumerateRNR!RR4R R)(RtclsRPtwR((s3/usr/lib/python2.7/site-packages/_pytest/recwarn.pyR4©s cC`sg|j(dS(s$Clear the list of recorded warnings.N(RN(R((s3/usr/lib/python2.7/site-packages/_pytest/recwarn.pytclear±scC`sK|jr"t}td|ƒ‚ntt|ƒjƒ|_tjdƒ|S(NsCannot enter %r twicetalways( RMR t RuntimeErrorRJRRRNRR(RR((s3/usr/lib/python2.7/site-packages/_pytest/recwarn.pyRµs   cG`s<|js"t}td|ƒ‚ntt|ƒj|ŒdS(Ns%Cannot exit %r without entering first(RMR R[RJRR.(Rtexc_infoR((s3/usr/lib/python2.7/site-packages/_pytest/recwarn.pyR.½s (R/R0R1RKtpropertyRORQRSRURR4RYRR.(((s3/usr/lib/python2.7/site-packages/_pytest/recwarn.pyR�s       R5cB`s eZddd„Zd„ZRS(cC`sºtt|ƒjƒd}t|tƒrdxy|D].}tj|ƒs/t|t|ƒƒ‚q/q/Wn@tj|ƒr|f}n%|dk r¤t|t|ƒƒ‚n||_ ||_ dS(NsDexceptions must be old-style classes or derived from Warning, not %s( RJR5RKRttupletinspecttisclasst TypeErrorttypeR%RDR3(RRDR3R-texc((s3/usr/lib/python2.7/site-packages/_pytest/recwarn.pyRKÅs     c`s1ttˆƒj|Œtd„|Dƒƒr-ˆjdk r-t‡fd†ˆDƒƒs�t}tdj ˆjgˆD]}|j ^qsƒƒq*ˆj dk r*x†ˆD]F}t |j ˆjƒr¥tjˆj ƒjt|j ƒƒrëPqëq¥q¥Wtdj ˆjˆj gˆD]}|j ^q ƒƒq*q-ndS(Ncs`s|]}|dkVqdS(N(R%(R"ta((s3/usr/lib/python2.7/site-packages/_pytest/recwarn.pys Úsc3`s$|]}t|jˆjƒVqdS(N(R!RRD(R"tr(R(s3/usr/lib/python2.7/site-packages/_pytest/recwarn.pys ÜssXDID NOT WARN. No warnings of type {0} was emitted. The list of emitted warnings is: {1}.siDID NOT WARN. No warnings of type {0} matching ('{1}') was emitted. The list of emitted warnings is: {2}.(RJR5R.tallRDR%R(R RtformatRR3R!RtreR?tsearchR6(RR\RteachRe((Rs3/usr/lib/python2.7/site-packages/_pytest/recwarn.pyR.Ös"  # $   N(R/R0R%RKR.(((s3/usr/lib/python2.7/site-packages/_pytest/recwarn.pyR5Äs(R1t __future__RRRR_t _pytest._codeR<R@R7RRht_pytest.fixturesRt_pytest.outcomesRR R%RtobjectR RHtcatch_warningsRR5(((s3/usr/lib/python2.7/site-packages/_pytest/recwarn.pyts        57