1j : 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 ZdedefdZdedededefdZ dede!deeef fdZ" 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 (.*)$KVreturnMonkeyPatchNNc # 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.11/venv/lib/python3.11/site-packages/_pytest/monkeypatch.pymonkeypatchr s+ 2 ]]F
LLL
KKMMMMM 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: )splitpop
__import__getattrAttributeErrorImportErrorstrannotated_getattr)r partsusedfoundpartexexpecteds r resolver. ; s JJsOOE99Q<