bg( hdZddlZddlZddlmZddlmZddlmZddlmZddlmZddlm Z dd lm Z dd l m Z d Z e rdd lmZndd lmZeZGddeZeefZGddeZGddeZGddeZe dedefZe de eZGddeeefZdedeegeeefffdZee d3dd d!ed"eed#eedefd$Zee d4d dd%d!ed&e d#eedefd'Z!eed5d!ed)e d#eedefd*Z" d6d+ed!ed#eedefd,Z#Gd-d.eZ$ee$d4d!edefd/Z% d7d0ed1eed!eedefd2Z&dS)8zZException classes and constants handling test outcomes as well as functions creating them.N)Any)Callable)cast)NoReturn)Optional)Type)TypeVar)KEYWORD_MSG_ARGF)Protocol)GenericcNeZdZdZd deededdffd ZdefdZeZ xZ S) OutcomeExceptionzmOutcomeException and its subclass instances indicate and contain info about test and collection outcomes.NTmsgpytracereturnc&|^t|tsId}t|t |jt |jt |||_||_ dS)NzY{} expected string as 'msg' parameter, got '{}' instead. Perhaps you meant to use a mark?) isinstancestr TypeErrorformattype__name__super__init__rr)selfrr error_msg __class__s a/builddir/build/BUILD/cloudlinux-venv-1.0.7/venv/lib/python3.11/site-packages/_pytest/outcomes.pyrzOutcomeException.__init__ s| ?:c3#7#7?3 I,,T$ZZ-@$s))BTUUVV V  c>|j|jSd|jjdS)N)rrr)rs r__repr__zOutcomeException.__repr__+s' 8 8O64>*6666r)NT) r __module__ __qualname____doc__rrboolrr"__str__ __classcell__rs@rrrs{++  HSM 4 4      7#7777 GGGGGrrc ReZdZdZ d dddeededed ed df fd ZxZS) SkippedbuiltinsNTF)_use_item_locationrrallow_module_levelr-rcjt||||_||_dS)Nrr)rrr.r-)rrrr.r-rs rrzSkipped.__init__;s: S'222"4#5r)NTF)rr#r$rrr&rr(r)s@rr+r+6sJ"#( 5 $) 5 5 5 c] 5 5! 5 ! 5  5 5 5 5 5 5 5 5 5 5rr+ceZdZdZdZdS)Failedz.Raised from an explicit call to pytest.fail().r,Nrr#r$r%rrr2r2Js88JJJrr2c@eZdZdZ ddedeeddffd ZxZS) Exitz=Raised for immediate program exits (no tracebacks/summaries).unknown reasonNr returncodercf||_||_t|dSN)rr8rr)rrr8rs rrz Exit.__init__Ss1$ r)r7N) rr#r$r%rrintrr(r)s@rr6r6PskGGHL7?} rr6_F.)bound_ETc$eZdZUeed<eed<dS)_WithException Exception__call__N)rr#r$r>__annotations__r<r4rrr@r@bs"NNNLLLLLrr@exception_typercTdtdtttfffd }|S)Nfuncrcdttttf|}|_|Sr:)rr@r<r>rA)rFfunc_with_exceptionrDs rdecoratez!_with_exception..decoratehs+">"c'#:DAA(6%""r)r<r@r>)rDrIs` r_with_exceptionrJgs?#r#nRW5###### Or)rreasonr8rcd}ddlm}|r |r |d|s8| |dtjt jdd |}t ||) axExit testing process. :param reason: The message to show as the reason for exiting pytest. reason has a default value only because `msg` is deprecated. :param returncode: Return code to be used when exiting pytest. :param msg: Same as ``reason``, but deprecated. Will be removed in a future version, use ``reason`` instead. Tr UsageErrorzHcannot pass reason and msg to exit(), `msg` is deprecated, use `reason`.Nz!exit() requires a reason argumentexitrF stacklevel)_pytest.configrOwarningswarnr rr6)rLr8r__tracebackhide__rOs rrPrPss ))))))  # j V     ;*@AA A o,&999aHHHH vz " ""r)r.rr.cJd}td||}t||)a`Skip an executing test with the given message. This function should be called only during testing (setup, call or teardown) or during collection by using the ``allow_module_level`` flag. This function can be called in doctests as well. :param reason: The message to show the user as reason for the skip. :param allow_module_level: Allows this function to be called at module level. Raising the skip exception at module level will stop the execution of the module and prevent the collection of all tests in the module, even those defined before the `skip` call. Defaults to False. :param msg: Same as ``reason``, but deprecated. Will be removed in a future version, use ``reason`` instead. .. note:: It is better to use the :ref:`pytest.mark.skipif ref` marker when possible to declare a test to be skipped under certain conditions like mismatching platforms or dependencies. Similarly, use the ``# doctest: +SKIP`` directive (see :py:data:`doctest.SKIP`) to skip a doctest statically. Tskip)rr.)_resolve_msg_to_reasonr+)rLr.rrXs rrZrZs/> #FFC 8 8F f1C D D DDrTrcJd}td||}t||)aExplicitly fail an executing test with the given message. :param reason: The message to show the user as reason for the failure. :param pytrace: If False, msg represents the full failure information and no python traceback will be reported. :param msg: Same as ``reason``, but deprecated. Will be removed in a future version, use ``reason`` instead. Tfailr0)r[r2)rLrrrXs rr]r]s. #FFC 8 8F VW - - --r func_namecd}|B|rddlm}|d|dtjt j|d |}|S) a Handles converting the deprecated msg parameter if provided into reason, raising a deprecation warning. This function will be removed when the optional msg argument is removed from here in future. :param str func_name: The name of the offending function, this is formatted into the deprecation message. :param str reason: The reason= passed into either pytest.fail() or pytest.skip() :param str msg: The msg= passed into either pytest.fail() or pytest.skip(). This will be converted into reason if it is provided to allow pytest.skip(msg=) or pytest.fail(msg=) to continue working in the interim period. :returns: The value to use as reason. TNrrNz.Passing both ``reason`` and ``msg`` to pytest.z(...) is not permitted.rQrS)pytestrOrVrWr r)r^rLrrXrOs rr[r[sz.    ) ) ) ) ) )*cccc   o,)<<<KKKK MrceZdZdZdS)XFailedz/Raised from an explicit call to pytest.xfail().Nr3r4rrrcrcs9999rrcc$d}t|)aImperatively xfail an executing test or setup function with the given reason. This function should be called only during testing (setup, call or teardown). :param reason: The message to show the user as reason for the xfail. .. note:: It is better to use the :ref:`pytest.mark.xfail ref` marker when possible to declare a test to be xfailed under certain conditions like known bugs or missing features. T)rc)rLrXs rxfailres &//rmodname minversioncddl}d}t|dd|j5|jd t |n.#t $r!}|d|d|}t |d dd}~wwxYw dddn #1swxYwYtj|}||St|d d}|:dd l m }|||||krt d |d |d|d |S)avImport and return the requested module ``modname``, or skip the current test if the module cannot be imported. :param modname: The name of the module to import. :param minversion: If given, the imported module's ``__version__`` attribute must be at least this minimal version, otherwise the test is still skipped. :param reason: If given, this reason is shown as the message when the module cannot be imported. :returns: The imported module. This should be assigned to its canonical name. Example:: docutils = pytest.importorskip("docutils") rNTrKevalignorezcould not import z: )r. __version__)Versionzmodule z has __version__ z, required is: ) rVcompilecatch_warnings simplefilter __import__ ImportErrorr+sysmodulesgetattrpackaging.versionrl) rfrgrLrVrXexcmodverattrrls r importorskiprys,OOO GR    " " E E h''' E w     E E E~?W??#??&T::: D E E E E E E E E E E E E E E E E +g C c=$//G------ ?ggg..1D1DDD'77GGGZZ1#'  Js4BA B A4A//A44BB B)rKN)rK)rKTNr:)NN)'r%rrrVtypingrrrrrrr _pytest.deprecatedr TYPE_CHECKINGtyping_extensionsr r BaseExceptionrrA TEST_OUTCOMEr+r2r6objectr<r>r@rJrr;rPr&rZr]r[rcreryr4rrrsl ...... ******* H}.!), 55555555(  9 WT#v+./// ge4 .///Xb#g& CHbT>"c';R5R,S26#PT### #"*3-#@H # ####< E49PT E E E  E-1 E@H  E  E E E EF...D.hsm.x....&7;!!!!&.sm!!!!!H:::::f:::#x$MQ44 4&sm4