| Server IP : 209.209.40.120 / Your IP : 216.73.217.112 Web Server : Microsoft-IIS/10.0 System : Windows NT NEWWWW 10.0 build 17763 (Windows Server 2019) i586 User : NEWWWW$ ( 0) PHP Version : 8.3.30 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/Python312/Lib/site-packages/_pytest/__pycache__/ |
Upload File : |
�
��Hg9 � �Z � d Z ddlmZ ddlmZ ddlZddlZddlZddlm Z ddlm
Z
ddlmZ ddlmZ dd lm
Z
dd
lmZ ddlmZ ddlZddlmZ dd
lmZ ej* d� Z ed� Z ed� Zedd�� Zdd�Zdd�Zdd�Z G d� d� Z e� Ze
G d� d� � Zy)z)Monkeypatching and mocking functionality.� )�annotations)�contextmanagerN)�Any)�final)� Generator)�Mapping)�MutableMapping)�overload)�TypeVar)�fixture)�
PytestWarningz^No module named (.*)$�K�Vc # �H K � t � } | �� | j � y�w)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) <pytest.MonkeyPatch.setattr>`
* :meth:`monkeypatch.delattr(obj, name, raising=True) <pytest.MonkeyPatch.delattr>`
* :meth:`monkeypatch.setitem(mapping, name, value) <pytest.MonkeyPatch.setitem>`
* :meth:`monkeypatch.delitem(obj, name, raising=True) <pytest.MonkeyPatch.delitem>`
* :meth:`monkeypatch.setenv(name, value, prepend=None) <pytest.MonkeyPatch.setenv>`
* :meth:`monkeypatch.delenv(name, raising=True) <pytest.MonkeyPatch.delenv>`
* :meth:`monkeypatch.syspath_prepend(path) <pytest.MonkeyPatch.syspath_prepend>`
* :meth:`monkeypatch.chdir(path) <pytest.MonkeyPatch.chdir>`
* :meth:`monkeypatch.context() <pytest.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() <pytest.MonkeyPatch.context>`.
N)�MonkeyPatch�undo)�mpatchs �5C:\Python312\Lib\site-packages\_pytest/monkeypatch.py�monkeypatchr s � �� �2 �]�F�
�L�
�K�K�M�s � "c �v � | j d� }|j d� }t |� }|D ] }|d|z z
} t ||� }� |S # t $ r Y nw xY w t |� nE# t
$ r9}t
|� j � d }||k( r� t d|� d|� �� |�d }~ww xY wt |||� }��)N�.r ���zimport error in z: )�split�pop�
__import__�getattr�AttributeError�ImportError�str�annotated_getattr)�name�parts�used�found�part�ex�expecteds r �resolver( <