§
|<ˆj : ã óê — d Z ddlZddlZddlZddlZddlmZ ddlmZ ddlm Z ddlm
Z
ddlmZ ddlmZ dd lm
Z
dd
lmZ ddlmZ ddlmZ dd
lmZ ddlmZ ddlmZ ddlmZ ej d¦ « Z ed¦ « Z ed¦ « Zede d fd„¦ « Zdedefd„Zdedededefd„Z dede!deeef fd„Z" G d„ d ¦ « Z# e#¦ « Z$e G d!„ d"¦ « ¦ « Z%dS )#z)Monkeypatching and mocking functionality.é N)Úcontextmanager)ÚAny)Ú Generator)ÚList)ÚMapping)ÚMutableMapping)ÚOptional)Úoverload)ÚTuple)ÚTypeVar)ÚUnion)Úfinal)Úfixture)Ú
PytestWarningz^No module named (.*)$ÚKÚVÚreturn©ÚMonkeyPatchNNc # óV K — t ¦ « } | V — | ¦ « dS )a
A convenient fixture for monkey-patching.
The fixture provides these methods to modify objects, dictionaries, or
:data:`os.environ`:
* :meth:`monkeypatch.setattr(obj, name, value, raising=True) `
* :meth:`monkeypatch.delattr(obj, name, raising=True) `
* :meth:`monkeypatch.setitem(mapping, name, value) `
* :meth:`monkeypatch.delitem(obj, name, raising=True) `
* :meth:`monkeypatch.setenv(name, value, prepend=None) `
* :meth:`monkeypatch.delenv(name, raising=True) `
* :meth:`monkeypatch.syspath_prepend(path) `
* :meth:`monkeypatch.chdir(path) `
* :meth:`monkeypatch.context() `
All modifications will be undone after the requesting test function or
fixture has finished. The ``raising`` parameter determines if a :class:`KeyError`
or :class:`AttributeError` will be raised if the set/deletion operation does not have the
specified target.
To undo modifications done by the fixture in a contained scope,
use :meth:`context() `.
N)r Úundo)Úmpatchs úe/builddir/build/BUILD/cloudlinux-venv-1.0.12/venv/lib/python3.11/site-packages/_pytest/monkeypatch.pyÚmonkeypatchr s+ è è € õ2 ‰]Œ]€FØ
€L€L€LØ
‡K‚K�M„M€M€M€Mó Únamec óÆ — | d¦ « }| d¦ « }t |¦ « }|D ]¤}|d|z z
} t ||¦ « }Œ# t $ r Y nw xY w t |¦ « nV# t
$ rI}t
|¦ « ¦ « d }||k r‚ t d|› d|› �¦ « |‚d }~ww xY wt |||¦ « }Œ¥|S )Nú.r éÿÿÿÿzimport error in z: )ÚsplitÚpopÚ
__import__ÚgetattrÚAttributeErrorÚImportErrorÚstrÚannotated_getattr)r ÚpartsÚusedÚfoundÚpartÚexÚexpecteds r Úresolver. ; s € à�JŠJ�s‰OŒO€Eà�9Š9�Q‰<Œ<€DݘtÑ$Ô$€EØð 5ð 5ˆØ��d‘
шð ݘE 4Ñ(Ô(ˆEð
øõ ð ð ð ØˆDð øøøð KÝ�tÑÔÐÐøÝð Kð Kð Kݘ2‘w”w—}’}‘” rÔ*ˆHؘ4ÒÐØå!Ð"A°TÐ"AÐ"A¸RÐ"AÐ"AÑBÔBÈÐJøøøøð Køøøõ " %¨¨tÑ4Ô4ˆˆØ€Ls+ ÁAÁ
A%Á$A%Á)A9Á9
CÂACÃCÚobjÚannc ó¼ — t | |¦ « } nI# t $ r<}t d t | ¦ « j ||¦ « ¦ « |‚d }~ww xY w| S )Nz'{!r} object at {} has no attribute {!r})r# r$ ÚformatÚtypeÚ__name__)r/ r r0 Úes r r' r' W sx € ðÝ�c˜4Ñ Ô ˆˆøÝð ð ð ÝØ5×<Ò<Ý�S‘ ” Ô" C¨ñ
ô
ñ
ô
ð ð øøøøðøøøð €Js ‚ “
A�7AÁAÚimport_pathÚraisingc óØ — t | t ¦ « rd| vrt d| ›�¦ « ‚| dd¦ « \ }}t |¦ « }|rt |||¬¦ « ||fS )Nr z)must be absolute import path string, not é )r0 )Ú
isinstancer&