§ |<ˆjï„ãó®—dZddlZddlZddlZddlZddlmZddlmZddlmZddlm Z ddlm Z ddlm Z dd lm Z dd l mZdd lmZdd lmZdd lmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddl m!Z!ddl"m#Z#ddl"m$Z$ddl"m%Z%ddl"m&Z&ddl"m'Z'ddl(m)Z)ddl*m+Z+dd l,m-Z-dd!l,m.Z.dd"l/m0Z0dd#l1m2Z2dd$l3m4Z4erej5e Z6dd%l7m8Z8nej5Z6d&Z9d'Z:ej;d(¦«Z<e2d)¦«Z=e2ee>eej f¦«Z?d*e>d+e>fd,„Z@Gd-„d.ejA¦«ZBGd/„d0eB¦«ZCGd1„d2ejD¦«ZEd3e$d4e>fd5„ZFd6e)d+dfd7„ZGed8ejH¬9¦«ZIGd:„d;¦«ZJGd<„d)e6¦«ZKe!Gd=„d>¦«¦«ZLe-d?e.d+eeLddffd@„¦«ZMd3e$dAe>d+eeNfdB„ZOe&dC¬D¦«d3e$d+dfdE„¦«ZPGdF„dG¦«ZQGdH„dIejR¦«ZSGdJ„dKe6¦«ZTGdL„dMejU¦«ZVdS)Nz!Access and control log capturing.éN)Úcontextmanager)Ú nullcontext)Údatetime)Ú timedelta)Útimezone)ÚStringIO)Ú LogRecord)ÚPath)Ú AbstractSet)ÚDict)Ú Generator)ÚList)ÚMapping)ÚOptional)ÚTuple)Ú TYPE_CHECKING)ÚTypeVar)ÚUnion)Únodes)ÚTerminalWriter)ÚCaptureManager)Úfinal)Ú _strtobool)ÚConfig)Úcreate_terminal_writer)Úhookimpl)Ú UsageError)ÚParser)Úcheck_ispytest)Úfixture)ÚFixtureRequest)ÚSession)ÚStashKey)ÚTerminalReporter)ÚLiteralz<%(levelname)-8s %(name)s:%(filename)s:%(lineno)d %(message)sz%H:%M:%Sz \x1b\[[\d;]+mÚLogCaptureHandlerÚtextÚreturncó8—t d|¦«S)NÚ)Ú_ANSI_ESCAPE_SEQÚsub)r's úa/builddir/build/BUILD/cloudlinux-venv-1.0.12/venv/lib/python3.11/site-packages/_pytest/logging.pyÚ_remove_ansi_escape_sequencesr.8s€Ý × Ò   DÑ )Ô )Ð)ócó.‡—eZdZdZddedefˆfd„ ZˆxZS)ÚDatetimeFormatterz²A logging formatter which formats record with :func:`datetime.datetime.strftime` formatter instead of :func:`time.strftime` in case of microseconds in format string. NÚrecordr(cóV•—|r…d|vr�| |j¦«}tt|j¬¦«|j¦«}t |dd…t|jdz¦«|dœŽ}|  |¦«St¦«  ||¦«S)Nz%f)Úsecondsréiè)Ú microsecondÚtzinfo) Ú converterÚcreatedrrÚ tm_gmtoffÚtm_zonerÚroundÚmsecsÚstrftimeÚsuperÚ formatTime)Úselfr2ÚdatefmtÚctÚtzÚdtÚ __class__s €r-r@zDatetimeFormatter.formatTimeBsžø€Ø ð (�t˜w��Ø—’ ¤Ñ/Ô/ˆBÝ�)¨B¬LÐ9Ñ9Ô9¸2¼:ÑFÔFˆBõ˜2˜a ˜cœ7µ°f´lÀTÑ6IÑ0JÔ0JÐSUÐVÐVÐVˆBØ—;’;˜wÑ'Ô'Ð 'å‰wŒw×!Ò! &¨'Ñ2Ô2Ð2r/©N)Ú__name__Ú __module__Ú __qualname__Ú__doc__r Ústrr@Ú __classcell__©rFs@r-r1r1<sZø€€€€€ððð 3ð 3 ð 3¸Sð 3ð 3ð 3ð 3ð 3ð 3ð 3ð 3ð 3ð 3r/r1có*‡—eZdZUdZejdhejddhejdhejdhej dhej dhej e ¦«iZ eeeefed<ejd¦«Zd ed d fˆfd „ Zd eded d fd„Zdejd efˆfd„ ZˆxZS)ÚColoredLevelFormatterzfA logging formatter which colorizes the %(levelname)..s part of the log format passed to __init__.ÚredÚboldÚyellowÚgreenÚpurpleÚLOGLEVEL_COLOROPTSz$%\(levelname\)([+-.]?\d*(?:\.\d+)?s)Úterminalwriterr(NcóÒ•—t¦«j|i|¤Ž||_|jj|_i|_|j ¦«D]\}}|j |g|¢RŽŒdSrG) r?Ú__init__Ú_terminalwriterÚ_styleÚ_fmtÚ _original_fmtÚ_level_to_fmt_mappingrVÚitemsÚadd_color_level)rArWÚargsÚkwargsÚlevelÚ color_optsrFs €r-rYzColoredLevelFormatter.__init__]s‡ø€Ø�‰ŒÔ˜$Ð) &Ð)Ð)Ð)Ø-ˆÔØ!œ[Ô-ˆÔØ57ˆÔ"à!%Ô!8×!>Ò!>Ñ!@Ô!@ð 5ð 5Ñ ˆE�:Ø ˆDÔ  Ð 4¨Ð 4Ð 4Ð 4Ð 4Ð 4ð 5ð 5r/rcrdcóF—|j€J‚|j |j¦«}|sdS| ¦«}|dt j|¦«iz}d„|D¦«}|jj|fi|¤Ž}|j ||j¦«|j |<dS)a¯Add or update color opts for a log level. :param level: Log level to apply a style to, e.g. ``logging.INFO``. :param color_opts: ANSI escape sequence color options. Capitalized colors indicates background color, i.e. ``'green', 'Yellow', 'bold'`` will give bold green text on yellow background. .. warning:: This is an experimental API. NÚ levelnamecó—i|]}|d“ŒS)T©)Ú.0Únames r-ú z9ColoredLevelFormatter.add_color_level..}s€Ð:Ð:Ð: t˜˜dÐ:Ð:Ð:r/) r\ÚLEVELNAME_FMT_REGEXÚsearchÚgroupÚloggingÚ getLevelNamerZÚmarkupr,r^)rArcrdÚlevelname_fmt_matchÚ levelname_fmtÚformatted_levelnameÚ color_kwargsÚcolorized_formatted_levelnames r-r`z%ColoredLevelFormatter.add_color_levelfsÑ€ðŒyÐ$Ð$Ð$Ø"Ô6×=Ò=¸d¼iÑHÔHÐØ"ð Ø ˆFØ+×1Ò1Ñ3Ô3ˆ à+¨{½GÔ&˜WÔ.ð&°3ð&ð&ð&ð&ð&ð&ð&ð&ð&ð&r/rPcó’‡—eZdZdZdedeeeedfddfˆfd„ Ze deeeedfdefd„¦«Z d e j defd „Z ˆxZS) ÚPercentStyleMultilinezÈA logging style with special support for multiline messages. If the message of a record consists of multiple lines, this style formats the message as if each line were logged separately. r{Ú auto_indentNr(có~•—t¦« |¦«| |¦«|_dSrG)r?rYÚ_get_auto_indentÚ _auto_indent)rAr{rŠrFs €r-rYzPercentStyleMultiline.__init__’s7ø€Ý ‰Œ×Ò˜ÑÔÐØ ×1Ò1°+Ñ>Ô>ˆÔÐÐr/Úauto_indent_optioncó>—|€dSt|t¦«r|rdSdSt|t¦«rt|¦«St|t¦«rD t|¦«S#t$rYnwxYw t |¦«rdSn#t$rYdSwxYwdS)aDetermine the current auto indentation setting. Specify auto indent behavior (on/off/fixed) by passing in extra={"auto_indent": [value]} to the call to logging.log() or using a --log-auto-indent [value] command line or the log_auto_indent [value] config option. Default behavior is auto-indent off. Using the string "True" or "on" or the boolean True as the value turns auto indent on, using the string "False" or "off" or the boolean False or the int 0 turns it off, and specifying a positive integer fixes the indentation position to the value specified. Any other values for the option are invalid, and will silently be converted to the default. :param None|bool|int|str auto_indent_option: User specified option for indentation from command line, config or extra kwarg. Accepts int, bool or str. str option accepts the same range of values as boolean config options, as well as positive integers represented in str form. :returns: Indentation value, which can be -1 (automatically determine indentation) or 0 (auto-indent turned off) or >0 (explicitly set indentation position). Nréÿÿÿÿ)Ú isinstanceÚboolr„rLÚ ValueErrorr)rŽs r-rŒz&PercentStyleMultiline._get_auto_indent–sç€ðB Ð %Ø�1Ý Ð*­DÑ 1Ô 1ð Ø!ð Ø�rà�qÝ Ð*­CÑ 0Ô 0ð ÝÐ)Ñ*Ô*Ð *Ý Ð*­CÑ 0Ô 0ð ð ÝÐ-Ñ.Ô.Ð.øÝð ð ð Ø�ð øøøð ÝÐ0Ñ1Ô1ðؘ2ðøåð ð ð Ø�q�qð øøøðˆqs$ÁA)Á) A6Á5A6Á:B  BÂBr2có¤—d|jvr¹t|d¦«r| |j¦«}n|j}|r…|j ¦«}|ji|j¥d|di¥z}|dkr)t|¦«  |d¦«}n|}||d<dd|zz  |¦«S|j|jzS)Nú rŠÚmessagerú ) r–ÚhasattrrŒrŠr�Ú splitlinesr\Ú__dict__r.ÚfindÚjoin)rAr2rŠÚlinesÚ formattedÚ indentations r-rzzPercentStyleMultiline.formatÍsê€Ø �6”>Ð !Ð !Ý�v˜}Ñ-Ô-ð 0à"×3Ò3°FÔ4FÑGÔG� � à"Ô/� àð >Øœ×1Ò1Ñ3Ô3�Ø œIÐ(P¨6¬?Ð(P¸IÀuÈQÄxÐ(PÐ(PÑP� à ’?�?Ý"?À Ñ"JÔ"J×"OÒ"Oؘaœñ#ô#�K�Kð #.�KØ$��a‘ؘs [Ñ0Ñ0×6Ò6°uÑ=Ô=Ð=ØŒy˜6œ?Ñ*Ð*r/)rHrIrJrKrLrr„r’rYÚ staticmethodrŒror rzrMrNs@r-r‰r‰‹sÌø€€€€€ððð ?˜Cð?¨e°C¸¸dÀDÐ4HÔ.Ið?Èdð?ð?ð?ð?ð?ð?ðð4¨U°3¸¸TÀ4Ð3GÔ-Hð4ÈSð4ð4ð4ñ„\ð4ðl+˜WÔ.ð+°3ð+ð+ð+ð+ð+ð+ð+ð+r/r‰ÚconfigÚnamescót—|D]4}| |¦«}|€| |¦«}|r|cSŒ5dSrG)Ú getoptionÚgetini)r¡r¢rjÚrets r-Úget_option_inir§åsZ€ØððˆØ×Ò˜tÑ$Ô$ˆØ ˆ;Ø—-’- Ñ%Ô%ˆCØ ð ØˆJˆJˆJð ð ðr/Úparserc󇇗‰ d¦«Šd.ˆˆfd„ }|ddddd¬¦«|d d td ¬ ¦«|d dtd¬ ¦«‰ dddd¬¦«|dddd¬ ¦«|dddd ¬ ¦«|dddd¬ ¦«|dddd¬ ¦«|dd dd!¬ ¦«|d"d#td ¬ ¦«|d$d%td¬ ¦«|d&d'dd(¬ ¦«‰ d)d*gd+d,¬-¦«dS)/z%Add options to control log capturing.roNcó`•—‰ |||d|z¬¦«‰j|fd|i|¤ŽdS)NzDefault value for ©ÚdefaultÚtypeÚhelpÚdest)ÚaddiniÚ addoption)Úoptionr¯r¬r­rbrnr¨s €€r-Úadd_option_iniz(pytest_addoption..add_option_iniòsTø€Ø� Š Ø ˜'¨Ð3GÈ&Ñ3Pð ñ ô ð 𠈌˜Ð4Ð4 TÐ4¨VÐ4Ð4Ð4Ð4Ð4r/z --log-levelÚ log_levelÚLEVELz™Level of messages to catch/display. Not set by default, so it depends on the root/parent log handler's effective level, where it is "WARNING" by default.)r¯r¬Úmetavarr®z --log-formatÚ log_formatz%Log format used by the logging module)r¯r¬r®z--log-date-formatÚlog_date_formatz*Log date format used by the logging moduleÚlog_cliFr’zAEnable log display during test run (also known as "live logging")r«ú--log-cli-levelÚ log_cli_levelzCLI logging levelz--log-cli-formatÚlog_cli_formatz--log-cli-date-formatÚlog_cli_date_formatz --log-fileÚlog_filez.Path to a file when logging will be written toz--log-file-levelÚlog_file_levelzLog file logging levelz--log-file-formatÚlog_file_formatz--log-file-date-formatÚlog_file_date_formatz--log-auto-indentÚlog_auto_indentzfAuto-indent multiline messages passed to the logging module. Accepts true|on, false|off or an integer.z --log-disableÚappendÚlogger_disablez7Disable a logger by name. Can be passed multiple times.)Úactionr¬r¯r®)NN)ÚgetgroupÚDEFAULT_LOG_FORMATÚDEFAULT_LOG_DATE_FORMATr°r±)r¨r³rns` @r-Úpytest_addoptionrÉîsHøø€à �OŠO˜IÑ &Ô &€Eð5ð5ð5ð5ð5ð5ð5ð €NØØ ØØð Bð ñ ô ð ð€NØØ Ý"Ø 4ð ñôðð €NØØ Ý'Ø 9ð ñôðð  ‡M‚MØØØ Ø Pð ñôðð €NØ ¸ÐDWðñôðð€NØØ ØØ 4ð ñôðð €NØØ "ØØ 9ð ñôðð €NØØ ØØ =ð ñôðð €NØØ ØØ %ð ñôðð €NØØ Ý"Ø 4ð ñôðð €NØ Ø #Ý'Ø 9ð ñôðð €NØØ ØØ uð ñôðð  ‡O‚OØØØØ Ø Fð ñôðððr/Ú _HandlerType)ÚboundcóD—eZdZdZdZd dedeeddfd„Zd„Z d „Z dS) Ú catching_logszCContext manager that prepares the whole logging machinery properly.)ÚhandlerrcÚ orig_levelNrÎrcr(có"—||_||_dSrG)rÎrc)rArÎrcs r-rYzcatching_logs.__init__Ts€ØˆŒ ؈Œ ˆ ˆ r/có6—tj¦«}|j�|j |j¦«| |j¦«|j�9|j|_| t|j|j¦«¦«|jSrG)roÚ getLoggerrcrÎÚsetLevelÚ addHandlerrÏÚmin)rAÚ root_loggers r-Ú __enter__zcatching_logs.__enter__Xs‚€ÝÔ'Ñ)Ô)ˆ Ø Œ:Ð !Ø ŒL× !Ò ! $¤*Ñ -Ô -Ð -Ø×Ò˜tœ|Ñ,Ô,Ð,Ø Œ:Ð !Ø)Ô/ˆDŒOØ × Ò ¥ T¤_°d´jÑ!AÔ!AÑ BÔ BÐ BØŒ|Ðr/có¢—tj¦«}|j�| |j¦«| |j¦«dSrG)rorÒrcrÓrÏÚ removeHandlerrÎ)rAr­ÚvalueÚ tracebackrÖs r-Ú__exit__zcatching_logs.__exit__bsJ€ÝÔ'Ñ)Ô)ˆ Ø Œ:Ð !Ø × Ò  ¤Ñ 1Ô 1Ð 1Ø×!Ò! $¤,Ñ/Ô/Ð/Ð/Ð/r/rG) rHrIrJrKÚ __slots__rÊrr„rYr×rÜrhr/r-rÍrÍOso€€€€€ØMÐMà2€Iðð  ð°X¸c´]ðÈdðððððððð0ð0ð0ð0ð0r/rÍcól‡—eZdZdZd ˆfd„ Zdejddfˆfd„ Zd d„Zd d„Z dejddfd „Z ˆxZ S) r&z;A logging handler that stores log records and the log text.r(Ncóp•—t¦« t¦«¦«g|_dS)zCreate a new log handler.N)r?rYrÚrecords)rArFs €r-rYzLogCaptureHandler.__init__ls*ø€å ‰Œ×Ò�™œÑ$Ô$Ð$Ø02ˆŒ ˆ ˆ r/r2có~•—|j |¦«t¦« |¦«dS)z;Keep the log records in a list in addition to the log text.N)ràrÃr?Úemit)rAr2rFs €r-râzLogCaptureHandler.emitqs5ø€à Œ ×Ò˜FÑ#Ô#Ð#Ý ‰Œ� Š �VÑÔÐÐÐr/có:—g|_t¦«|_dSrG)ràrÚstream©rAs r-ÚresetzLogCaptureHandler.resetvs€ØˆŒ Ý‘j”jˆŒ ˆ ˆ r/có^—|j ¦«t¦«|_dSrG)ràÚclearrrärås r-rèzLogCaptureHandler.clearzs%€Ø Œ ×ÒÑÔÐÝ‘j”jˆŒ ˆ ˆ r/có —tjr‚dSrG)roÚraiseExceptions©rAr2s r-Ú handleErrorzLogCaptureHandler.handleError~s€Ý Ô "ð ð ð  ð r/©r(N) rHrIrJrKrYror rârærèrìrMrNs@r-r&r&is¿ø€€€€€ØEÐEð3ð3ð3ð3ð3ð3ð ˜7Ô,ð°ððððððð !ð!ð!ð!ð!ð!ð!ð!ð 'Ô"3ð¸ððððððððr/c óè—eZdZdZddœdejdeddfd„Zdd „Ze de fd „¦«Z d d de e jfd „Ze defd„¦«Ze de e jfd„¦«Ze de eeeeffd„¦«Ze de efd„¦«Zdd„Zdeeefde jdefd„Zddeeefdeeddfd„Ze ddeeefdeededfd„¦«ZdS)ÚLogCaptureFixturez-Provides access and control of log capturing.F©Ú _ispytestÚitemrñr(Ncó\—t|¦«||_d|_i|_d|_dSrG)rÚ_itemÚ_initial_handler_levelÚ_initial_logger_levelsÚ_initial_disabled_logging_level)rAròrñs r-rYzLogCaptureFixture.__init__‹s5€Ý�yÑ!Ô!Ð!؈Œ Ø59ˆÔ#à@BˆÔ#Ø>BˆÔ,Ð,Ð,r/có4—|j�|j |j¦«|j ¦«D].\}}t j|¦«}| |¦«Œ/|j�"t j|j¦«d|_dSdS)z‚Finalize the fixture. This restores the log levels and the disabled logging levels changed by :meth:`set_level`. N) rõrÎrÓrör_rorÒr÷Údisable)rAÚ logger_namercÚloggers r-Ú _finalizezLogCaptureFixture._finalize“s €ð Ô &Ð 2Ø ŒL× !Ò ! $Ô"=Ñ >Ô >Ð >Ø"&Ô"=×"CÒ"CÑ"EÔ"Eð #ð #Ñ ˆK˜ÝÔ& {Ñ3Ô3ˆFØ �OŠO˜EÑ "Ô "Ð "Ð "à Ô /Ð ;Ý ŒO˜DÔ@Ñ AÔ AÐ AØ37ˆDÔ 0Ð 0Ð 0ð <Ð ;r/có0—|jjtS)z,Get the logging handler used by the fixture.)rôÚstashÚcaplog_handler_keyrås r-rÎzLogCaptureFixture.handler£s€ðŒzÔÕ 2Ô3Ð3r/Úwhenz$Literal['setup', 'call', 'teardown']cóX—|jjt |g¦«S)a5Get the logging records for one of the possible test phases. :param when: Which test phase to obtain the records from. Valid values are: "setup", "call" and "teardown". :returns: The list of captured records at the given stage. .. versionadded:: 3.4 )rôrþÚcaplog_records_keyrx©rArs r-Ú get_recordszLogCaptureFixture.get_records¨s%€ðŒzÔÕ 2Ô3×7Ò7¸¸bÑAÔAÐAr/cóX—t|jj ¦«¦«S)zThe formatted log text.)r.rÎräÚgetvaluerås r-r'zLogCaptureFixture.text·s#€õ-¨T¬\Ô-@×-IÒ-IÑ-KÔ-KÑLÔLÐLr/có—|jjS)zThe list of log records.)rÎràrås r-ràzLogCaptureFixture.records¼s€ðŒ|Ô#Ð#r/có$—d„|jD¦«S)z¿A list of a stripped down version of log records intended for use in assertion comparison. The format of the tuple is: (logger_name, log_level, message) cóP—g|]#}|j|j| ¦«f‘Œ$Srh)rjryÚ getMessage©riÚrs r-ú z3LogCaptureFixture.record_tuples..Ês+€ÐJÐJÐJ¸�”˜œ A§L¢L¡N¤NÐ3ÐJÐJÐJr/©ràrås r-Ú record_tupleszLogCaptureFixture.record_tuplesÁs€ðKÐJ¸T¼\ÐJÑJÔJÐJr/có$—d„|jD¦«S)a�A list of format-interpolated log messages. Unlike 'records', which contains the format string and parameters for interpolation, log messages in this list are all interpolated. Unlike 'text', which contains the output from the handler, log messages in this list are unadorned with levels, timestamps, etc, making exact comparisons more reliable. Note that traceback or stack info (from :func:`logging.exception` or the `exc_info` or `stack_info` arguments to the logging functions) is not included, as this is added by the formatter in the handler. .. versionadded:: 3.7 có6—g|]}| ¦«‘ŒSrh)r r s r-r z.LogCaptureFixture.messages..Ýs €Ð5Ð5Ð5 1�— ’ ‘”Ð5Ð5Ð5r/rrås r-ÚmessageszLogCaptureFixture.messagesÌs€ð"6Ð5¨¬ Ð5Ñ5Ô5Ð5r/có8—|j ¦«dS)z8Reset the list of log records and the captured log text.N)rÎrèrås r-rèzLogCaptureFixture.clearßs€à Œ ×ÒÑÔÐÐÐr/rcÚ logger_objcód—|jj}t|t¦«rt j|¦«}t|t ¦«st jtj¦«nF| |¦«s1t|dz tj¦«}t j|¦«|S)aPEnable the desired logging level if the global level was disabled via ``logging.disabled``. Only enables logging levels greater than or equal to the requested ``level``. Does nothing if the desired ``level`` wasn't disabled. :param level: The logger level caplog should capture. All logging is enabled if a non-standard logging level string is supplied. Valid level strings are in :data:`logging._nameToLevel`. :param logger_obj: The logger object to check. :return: The original disabled logging level. é ) Úmanagerrùr‘rLrorpr„r‚Ú isEnabledForÚmax)rArcrÚoriginal_disable_levelÚ disable_levels r-Ú_force_enable_loggingz'LogCaptureFixture._force_enable_loggingãsœ€ð"'1Ô&8Ô&@Ðå �e�SÑ !Ô !ð 0åÔ(¨Ñ/Ô/ˆEå˜%¥Ñ%Ô%ð +å ŒO�GœNÑ +Ô +Ð +Ð +Ø×(Ò(¨Ñ/Ô/ð +õ  ¨¡ ­G¬NÑ;Ô;ˆMÝ ŒO˜MÑ *Ô *Ð *à%Ð%r/rûcóH—tj|¦«}|j ||j¦«| |¦«|j€|jj|_|j |¦«| ||¦«}|j € ||_ dSdS)aSet the threshold level of a logger for the duration of a test. Logging messages which are less severe than this level will not be captured. .. versionchanged:: 3.4 The levels of the loggers changed by this function will be restored to their initial values at the end of the test. Will enable the requested logging level if it was disabled via :meth:`logging.disable`. :param level: The level. :param logger: The logger to update. If not given, the root logger. N) rorÒröÚ setdefaultrcrÓrõrÎrr÷)rArcrûrÚinitial_disabled_logging_levels r-Ú set_levelzLogCaptureFixture.set_levels¥€õÔ& vÑ.Ô.ˆ à Ô#×.Ò.¨v°zÔ7GÑHÔHÐHØ×Ò˜EÑ"Ô"Ð"Ø Ô &Ð .Ø*.¬,Ô*<ˆDÔ 'Ø Œ ×Ò˜eÑ$Ô$Ð$Ø)-×)CÒ)CÀEÈ:Ñ)VÔ)VÐ&Ø Ô /Ð 7Ø3QˆDÔ 0Ð 0Ð 0ð 8Ð 7r/©NNNc#óK—tj|¦«}|j}| |¦«|jj}|j |¦«| ||¦«} dV—| |¦«|j |¦«tj|¦«dS#| |¦«|j |¦«tj|¦«wxYw)auContext manager that sets the level for capturing of logs. After the end of the 'with' statement the level is restored to its original value. Will enable the requested logging level if it was disabled via :meth:`logging.disable`. :param level: The level. :param logger: The logger to update. If not given, the root logger. N)rorÒrcrÓrÎrrù)rArcrûrrÏÚhandler_orig_levelrs r-Úat_levelzLogCaptureFixture.at_levelsèè€õÔ& vÑ.Ô.ˆ ØÔ%ˆ Ø×Ò˜EÑ"Ô"Ð"Ø!œ\Ô/ÐØ Œ ×Ò˜eÑ$Ô$Ð$Ø!%×!;Ò!;¸EÀ:Ñ!NÔ!NÐð 4Ø ˆEˆEˆEà × Ò   Ñ +Ô +Ð +Ø ŒL× !Ò !Ð"4Ñ 5Ô 5Ð 5Ý ŒOÐ2Ñ 3Ô 3Ð 3Ð 3Ð 3øð × Ò   Ñ +Ô +Ð +Ø ŒL× !Ò !Ð"4Ñ 5Ô 5Ð 5Ý ŒOÐ2Ñ 3Ô 3Ð 3Ð 3øøøs Á0B9Â9AC>rírG) rHrIrJrKrÚNoder’rYrüÚpropertyr&rÎrror rrLr'ràrr„rrrèrÚLoggerrrr rr r$rhr/r-rïrï‡sk€€€€€à7Ð7à>CðCðCðC˜UœZðC°tðCÈðCðCðCðCð8ð8ð8ð8ð ð4Ð*ð4ð4ð4ñ„Xð4ð BØ:ð Bà ˆgÔÔ ð Bð Bð Bð BððM�cðMðMðMñ„XðMðð$˜˜gÔ/Ô0ð$ð$ð$ñ„Xð$ððK˜t E¨#¨s°C¨-Ô$8Ô9ðKðKðKñ„XðKðð6˜$˜sœ)ð6ð6ð6ñ„Xð6ð$ðððð &ؘ3 ˜8”_ð &Ø29´.ð &à ð &ð &ð &ð &ðDRðR˜u S¨# XœðR¸À¼ ðRÐQUðRðRðRðRð2à>Bð4ð4ؘ3 ˜8”_ð4Ø.6°s¬mð4à Ð#Ô $ð4ð4ð4ñ„^ð4ð4ð4r/rïÚrequestc#ófK—t|jd¬¦«}|V—| ¦«dS)aëAccess and control log capturing. Captured logs are available through the following properties/methods:: * caplog.messages -> list of format-interpolated log messages * caplog.text -> string containing formatted log output * caplog.records -> list of logging.LogRecord instances * caplog.record_tuples -> list of (logger_name, level, message) tuples * caplog.clear() -> clear captured records and formatted log output string TrðN)rïÚnoderü)r(Úresults r-Úcaplogr,9s=èè€õ˜wœ|°tÐ <Ñ <Ô <€FØ €L€L€LØ ×ÒÑÔÐÐÐr/Ú setting_namescóv—|D]2}| |¦«}|€| |¦«}|rnŒ3dSt|t¦«r| ¦«} t t t||¦«¦«S#t$r)}td  ||¦«¦«|‚d}~wwxYw)Nzo'{}' is not recognized as a logging level name for '{}'. Please consider passing the logging level num instead.) r¤r¥r‘rLÚupperr„Úgetattrror“rrz)r¡r-Ú setting_namer´Úes r-Úget_log_level_for_settingr3JsÞ€Ø%ððˆ Ø×$Ò$ \Ñ2Ô2ˆ Ø Ð ØŸ š  lÑ3Ô3ˆIØ ð Ø ˆEð ðˆtå�)�SÑ!Ô!ð&Ø—O’OÑ%Ô%ˆ ðÝ•7�7 I¨yÑ9Ô9Ñ:Ô:Ð:øÝ ðððåð )ç)/ª° ¸<Ñ)HÔ)Hñ ô ðð  øøøøðøøøsÁ""B B8Â$B3Â3B8T)ÚtrylastcóV—|j t|¦«d¦«dS)Nzlogging-plugin)Ú pluginmanagerÚregisterÚ LoggingPlugin)r¡s r-Úpytest_configurer9bs*€à Ô×!Ò!¥-°Ñ"7Ô"7Ð9IÑJÔJÐJÐJÐJr/có¼—eZdZdZdeddfd„Zdeeddfd„Zd„Z d eddfd „Z d „Z e d d ¬ ¦«de dfd„¦«Ze d d ¬ ¦«de dfd„¦«Ze d ¬¦«dede dfd„¦«Ze dd„¦«Ze dd„¦«Zdejdede dfd„Ze d ¬¦«dejde dfd„¦«Ze d ¬¦«dejde dfd„¦«Ze d ¬¦«dejde dfd„¦«Ze dd„¦«Ze d d ¬ ¦«de dfd„¦«Ze dd„¦«ZdS) r8zGAttaches to the logging module and captures log messages for each test.r¡r(Ncó—||_| t|d¦«t|d¦«t|d¦«¦«|_t |d¦«|_t ¦«|_|j |j¦«t ¦«|_ |j  |j¦«t |d¦«|_ t|d¦«p tj }|tj krotj  tj  |¦«¦«}tj  |¦«stj|¦«t%|dd¬ ¦«|_t|d d¦«}t|d d¦«}t)||¬ ¦«}|j |¦«t |d d¦«|_| ¦«rJ|j d¦«}|j d¦«}t3||¦«|_nt7¦«|_| t|dd¦«t|dd¦«t|d¦«¦«} |j | ¦«| |jj¬¦«dS)z¶Create a new plugin to capture log messages. The formatter can be safely shared across all handlers so create a single one for the entire test session here. r·r¸rÂr´r¿r¾ÚwúUTF-8©ÚmodeÚencodingrÀrÁ)rBr»ÚterminalreporterÚcapturemanagerr¼r½)Úloggers_to_disableN)Ú_configÚ_create_formatterr§Ú formatterr3r´r&Úcaplog_handlerÚ setFormatterÚreport_handlerr¿ÚosÚdevnullÚpathÚdirnameÚabspathÚisdirÚmakedirsÚ _FileHandlerÚlog_file_handlerr1r»Ú_log_cli_enabledr6Ú get_pluginÚ_LiveLoggingStreamHandlerÚlog_cli_handlerÚ_LiveLoggingNullHandlerÚ_disable_loggersr²rÄ) rAr¡r¾Ú directoryrÀrÁÚlog_file_formatterÚterminal_reporterÚcapture_managerÚlog_cli_formatters r-rYzLoggingPlugin.__init__js²€ð ˆŒ ð×/Ò/Ý ˜6 <Ñ 0Ô 0Ý ˜6Ð#4Ñ 5Ô 5Ý ˜6Ð#4Ñ 5Ô 5ñ ô ˆŒõ 3°6¸;ÑGÔGˆŒÝ/Ñ1Ô1ˆÔØ Ô×(Ò(¨¬Ñ8Ô8Ð8Ý/Ñ1Ô1ˆÔØ Ô×(Ò(¨¬Ñ8Ô8Ð8õ8¸Ð@PÑQÔQˆÔÝ! &¨*Ñ5Ô5ÐC½¼ˆØ •r”zÒ !Ð !ÝœŸš­¬¯ª¸Ñ(AÔ(AÑBÔBˆIÝ”7—=’= Ñ+Ô+ð 'Ý” ˜IÑ&Ô&Ð&å ,¨X¸CÈ'Ð RÑ RÔ RˆÔÝ(¨Ð1BÀLÑQÔQˆÝ-Ø Ð*Ð,=ñ ô Ðõ/Ø Ð%9ð ñ ô Ðð Ô×*Ò*Ð+=Ñ>Ô>Ð>õ7Ø �O [ñ ô ˆÔð × Ò Ñ "Ô "ð =Ø &Ô 4× ?Ò ?Ð@RÑ SÔ SÐ Ø$Ô2×=Ò=Ð>NÑOÔOˆOõ*Ð*;¸_ÑMÔMð Ô Ð õ$;Ñ#<Ô#<ˆDÔ Ø ×2Ò2Ý ˜6Ð#3°\Ñ BÔ BÝ ˜6Ð#8Ð:KÑ LÔ LÝ ˜6Ð#4Ñ 5Ô 5ñ ô Ðð Ô×)Ò)Ð*;Ñ<Ô<Ð<Ø ×Ò°´Ô1MÐÑNÔNÐNÐNÐNr/rCcóN—|sdS|D]}tj|¦«}d|_ŒdS)NT)rorÒÚdisabled)rArCrjrûs r-rXzLoggingPlugin._disable_loggers¦sA€Ø!ð Ø ˆFà&ð #ð #ˆDÝÔ& tÑ,Ô,ˆFØ"ˆFŒOˆOð #ð #r/có.—t|jjdd¦«}|dkrCtj |¦«r$tt |j¦«||¦«}nt||¦«}t|j j |¬¦«|_ |S)NÚcolorÚno)rŠ) r0rDr²rPrlrmrr1r‰r[r\)rAr·r¸rŠrarFs r-rEzLoggingPlugin._create_formatter®sœ€å˜œ Ô+¨W°dÑ;Ô;ˆØ �DŠ=ˆ=Õ2ÔF×MÒMØ ñ ô ˆ=õ,AÝ& t¤|Ñ4Ô4°jÀ/ñ,ô,ˆIˆIõ*¨*°oÑFÔFˆIå0Ø Ô Ô !¨{ð ñ ô ˆ ÔðÐr/Úfnamecóf—t|¦«}| ¦«s|jj|z }|j ¦«s|j dd¬¦«| dd¬¦«}|j  |¦«}|r|  ¦«dSdS)zµSet the filename parameter for Logging.FileHandler(). Creates parent directory if it does not exist. .. warning:: This is an experimental API. T)Úexist_okÚparentsr<r=r>N) r Ú is_absoluterDÚrootpathÚparentÚexistsÚmkdirÚopenrRÚ setStreamÚclose)rArcÚfpathräÚ old_streams r-Ú set_log_pathzLoggingPlugin.set_log_pathÀsº€õ�U‘ ” ˆà× Ò Ñ"Ô"ð 2Ø”LÔ)¨EÑ1ˆEàŒ|×"Ò"Ñ$Ô$ð <Ø ŒL× Ò ¨°dÐ Ñ ;Ô ;Ð ;ð$)§:¢:°3À :Ñ#IÔ#IˆØÔ*×4Ò4°VÑ<Ô<ˆ Ø ð Ø × Ò Ñ Ô Ð Ð Ð ð ð r/cóÀ—|j d¦«dup|j d¦«}|sdS|jj d¦«}|€dSdS)z'Return whether live logging is enabled.rºNr¹FrAT)rDr¤r¥r6rT)rAÚenabledr[s r-rSzLoggingPlugin._log_cli_enabledÖsx€à”,×(Ò(Ø ñ ô àðð8àœ×,Ò,¨YÑ7Ô7ð ðð Ø�5à œLÔ6×AÒAÐBTÑUÔUÐØ Ð $à�5àˆtr/T)Ú hookwrapperÚtryfirstr!c#óK—|j d¦«t|j|j¬¦«5t|j|j¬¦«5dV—ddd¦«n #1swxYwYddd¦«dS#1swxYwYdS)NÚ sessionstart©rc©rVÚset_whenrÍr»rRr¿rås r-Úpytest_sessionstartz!LoggingPlugin.pytest_sessionstartåsèè€à Ô×%Ò% nÑ5Ô5Ð5å ˜4Ô/°tÔ7IÐ JÑ JÔ Jð ð ݘtÔ4¸DÔÔ Ô ,ð Ø ˆEˆEˆEØ ˆFà × Ò Ñ "Ô "ð , t¤|×'=Ò'=¸iÑ'HÔ'HÈ1Ò'LÐ'Là*+ˆDŒLÔ Ô 'å ˜4Ô/°tÔ7IÐ JÑ JÔ Jð ð ݘtÔ4¸DÔðððñ/Ô.ðð€X˜$ÐÑÔð ¨'ð °iÐ@PÔ6Qð ð ð ñ Ôð ðð/ð/ð/ñ„Xð/ðð3ð3ð3ñ„Xð3ð6 ¤ð6°3ð6¸9ÐEUÔ;Vð6ð6ð6ð6ð&€X˜$ÐÑÔð4¨¬ð4¸ ÐBRÔ8Sð4ð4ð4ñ Ôð4ð€X˜$ÐÑÔð3¨¬ ð3°yÐAQÔ7Rð3ð3ð3ñ Ôð3ð €X˜$ÐÑÔð+¨E¬Jð+¸9ÐEUÔ;Vð+ð+ð+ñ Ôð+ðð0ð0ð0ñ„Xð0ð€X˜$¨Ð.Ñ.Ô.ð iÐ0@Ô&Aðððñ/Ô.ððð&ð&ð&ñ„Xð&ð&ð&r/r8có,—eZdZdZdejddfd„ZdS)rQz)A logging FileHandler with pytest tweaks.r2r(Ncó—dSrGrhrës r-rìz_FileHandler.handleErrorKó€à ˆr/)rHrIrJrKror rìrhr/r-rQrQHs?€€€€€Ø3Ð3ð  'Ô"3ð ¸ð ð ð ð ð ð r/rQc󨇗eZdZUdZdZeed<dedeeddfˆfd„ Z dd„Z d ee ddfd „Z d e jddfˆfd „ Zd e jddfd „ZˆxZS)rUaA logging StreamHandler used by the live logging feature: it will write a newline before the first log message in each test. During live logging we must also explicitly disable stdout/stderr capturing otherwise it will get captured and won't appear in the terminal. Nrär[r\r(c󺕗t¦« |¬¦«||_| ¦«| d¦«d|_dS)N)räF)r?rYr\rærzÚ_test_outcome_written)rAr[r\rFs €r-rYz"_LiveLoggingStreamHandler.__init__]sVø€õ ‰Œ×ÒÐ 1ÐÑ2Ô2Ð2Ø.ˆÔØ � Š ‰ Œ ˆ Ø � Š �dÑÔÐØ%*ˆÔ"Ð"Ð"r/có—d|_dS)zBReset the handler; should be called before the start of each test.FN)Ú_first_record_emittedrås r-ræz_LiveLoggingStreamHandler.reseths€à%*ˆÔ"Ð"Ð"r/rcó@—||_d|_|dkr d|_dSdS)z7Prepare for the given test phase (setup/call/teardown).Fr‡N)Ú_whenÚ_section_name_shownr«rs r-rzz"_LiveLoggingStreamHandler.set_whenls/€àˆŒ Ø#(ˆÔ Ø �7Š?ˆ?Ø).ˆDÔ &Ð &Ð &ð ˆ?r/r2có•—|jr|j ¦«n t¦«}|5|js"|j d¦«d|_n1|jdvr(|js!d|_|j d¦«|js3|jr,|j  d|jzdd¬¦«d|_t¦«  |¦«ddd¦«dS#1swxYwYdS)Nr•T)r›ržz live log ú-)ÚseprR) r\Úglobal_and_fixture_disabledrr­räÚwriter¯r«r°Úsectionr?râ)rAr2Ú ctx_managerrFs €r-râz_LiveLoggingStreamHandler.emitssUø€ðÔ#ð ˆDÔ × <Ò <Ñ >Ô >Ð >å‘”ð ð ð !ð !ØÔ-ð ,Ø” ×!Ò! $Ñ'Ô'Ð'Ø-1�Ô*Ð*Ø”Ð5Ð5Ð5ØÔ1ð,Ø15�DÔ.Ø”K×%Ò% dÑ+Ô+Ð+ØÔ+ð 0°´ ð 0Ø” ×#Ò# K°$´*Ñ$<À#ÈDÐ#ÑQÔQÐQØ+/�Ô(Ý ‰GŒG�LŠL˜Ñ Ô Ð ð !ð !ð !ñ !ô !ð !ð !ð !ð !ð !ð !ð !øøøð !ð !ð !ð !ð !ð !s²B6C5Ã5C9Ã<C9có—dSrGrhrës r-rìz%_LiveLoggingStreamHandler.handleError†r¨r/rí)rHrIrJrKrär$r…rrrYrærLrzror rârìrMrNs@r-rUrUPs ø€€€€€€ððð $€FÐ Ð#Ð#Ñ#ð +à+ð +ð" .Ô1ð +ð ð +ð +ð +ð +ð +ð +ð+ð+ð+ð+ð/˜X cœ]ð/¨tð/ð/ð/ð/ð!˜7Ô,ð!°ð!ð!ð!ð!ð!ð!ð&  'Ô"3ð ¸ð ð ð ð ð ð ð ð r/rUcóD—eZdZdZd d„Zdeddfd„Zdejddfd„Z dS) rWz5A logging handler used when live logging is disabled.r(Ncó—dSrGrhrås r-ræz_LiveLoggingNullHandler.resetŽó€Ø ˆr/rcó—dSrGrhrs r-rzz _LiveLoggingNullHandler.set_when‘r»r/r2có—dSrGrhrës r-rìz#_LiveLoggingNullHandler.handleError”r¨r/rí) rHrIrJrKrærLrzror rìrhr/r-rWrW‹su€€€€€Ø?Ð?ð ð ð ð ð ˜Sð  Tð ð ð ð ð  'Ô"3ð ¸ð ð ð ð ð ð r/rW)WrKÚiororJr†Ú contextlibrrrrrrr Úpathlibr Útypingr r r rrrrrrrÚ_pytestrÚ _pytest._iorÚ_pytest.capturerÚ_pytest.compatrÚ_pytest.configrrrrrÚ_pytest.config.argparsingrÚ_pytest.deprecatedrÚ_pytest.fixturesr r!Ú _pytest.mainr"Ú _pytest.stashr#Ú_pytest.terminalr$Ú StreamHandlerÚlogging_StreamHandlerÚtyping_extensionsr%rÇrÈr‡r+rÿrLrr.Ú Formatterr1rPÚ PercentStyler‰r§rÉÚHandlerrÊrÍr&rïr,r„r3r9r8Ú FileHandlerrQrUÚ NullHandlerrWrhr/r-úrÕs.ðØ'Ð'Ø € € € Ø€€€Ø € € € Ø € € € Ø%Ð%Ð%Ð%Ð%Ð%Ø"Ð"Ð"Ð"Ð"Ð"ØÐÐÐÐÐØÐÐÐÐÐØÐÐÐÐÐØÐÐÐÐÐØÐÐÐÐÐØÐÐÐÐÐØÐÐÐÐÐØÐÐÐÐÐØÐÐÐÐÐØÐÐÐÐÐØÐÐÐÐÐØÐÐÐÐÐØÐÐÐÐÐØ Ð Ð Ð Ð Ð ØÐÐÐÐÐØÐÐÐÐÐàÐÐÐÐÐØ&Ð&Ð&Ð&Ð&Ð&Ø*Ð*Ð*Ð*Ð*Ð*Ø Ð Ð Ð Ð Ð Ø%Ð%Ð%Ð%Ð%Ð%Ø!Ð!Ð!Ð!Ð!Ð!Ø1Ð1Ð1Ð1Ð1Ð1Ø#Ð#Ð#Ð#Ð#Ð#Ø%Ð%Ð%Ð%Ð%Ð%Ø,Ð,Ð,Ð,Ð,Ð,Ø-Ð-Ð-Ð-Ð-Ð-Ø$Ð$Ð$Ð$Ð$Ð$Ø+Ð+Ð+Ð+Ð+Ð+Ø Ð Ð Ð Ð Ð Ø"Ð"Ð"Ð"Ð"Ð"Ø-Ð-Ð-Ð-Ð-Ð-àð2Ø#Ô1°(Ô;Ðà)Ð)Ð)Ð)Ð)Ð)Ð)à#Ô1ÐàSÐØ$ÐØ�2”:Ð.Ñ/Ô/ÐØ2�XÐ1Ô2Ñ4Ô4ÐØA�X˜d 3¨¨WÔ->Ô(?Ð#?Ô@ÔAÑCÔCÐð*¨ð*°ð*ð*ð*ð*ð3ð3ð3ð3ð3˜Ô)ñ3ô3ð3ð$:&ð:&ð:&ð:&ð:&Ð-ñ:&ô:&ð:&ðzW+ðW+ðW+ðW+ðW+˜GÔ0ñW+ôW+ðW+ðt˜6ð¨3ðððððZ˜VðZ¨ðZðZðZðZðzˆw�~¨W¬_Ð=Ñ=Ô=€ ð0ð0ð0ð0ð0ñ0ô0ð0ð4ððððÐ-ñôðð<ðn4ðn4ðn4ðn4ðn4ñn4ôn4ñ„ðn4ðb ð �Nð  yÐ1BÀDÈ$Ð1NÔ'Oð ð ð ñ „ð ð  fð¸cðÀhÈsÄmððððð0 €�$ÐÑÔðK˜VðK¨ðKðKðKñÔðKð^&ð^&ð^&ð^&ð^&ñ^&ô^&ð^&ðB ð ð ð ð �7Ô&ñ ô ð ð8 ð8 ð8 ð8 ð8 Ð 5ñ8 ô8 ð8 ðv  ð  ð  ð  ð  ˜gÔ1ñ  ô  ð  ð  ð  r/