| 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 : |
�
��Hg � � � d dl mZ d dlmZ d dlmZ d dlmZ d dlmZ ddgZ ed� Z ed � Z G d
� dee � Z
G d� d� Zy)
� )�annotations)�Any)�cast)�Generic)�TypeVar�Stash�StashKey�T�Dc � � e Zd ZdZdZy)r z�``StashKey`` is an object used as a key to a :class:`Stash`.
A ``StashKey`` is associated with the type ``T`` of the value of the key.
A ``StashKey`` is unique and cannot conflict with another key.
.. versionadded:: 7.0
� N)�__name__�
__module__�__qualname__�__doc__� __slots__r
� �/C:\Python312\Lib\site-packages\_pytest/stash.pyr r s � �� �Ir c �T � e Zd ZdZdZdd�Zd
d�Zdd�Zdd�Zdd�Z dd�Z
dd �Zdd
�Zy)r aJ ``Stash`` is a type-safe heterogeneous mutable mapping that
allows keys and value types to be defined separately from
where it (the ``Stash``) is created.
Usually you will be given an object which has a ``Stash``, for example
:class:`~pytest.Config` or a :class:`~_pytest.nodes.Node`:
.. code-block:: python
stash: Stash = some_object.stash
If a module or plugin wants to store data in this ``Stash``, it creates
:class:`StashKey`\s for its keys (at the module level):
.. code-block:: python
# At the top-level of the module
some_str_key = StashKey[str]()
some_bool_key = StashKey[bool]()
To store information:
.. code-block:: python
# Value type must match the key.
stash[some_str_key] = "value"
stash[some_bool_key] = True
To retrieve the information:
.. code-block:: python
# The static type of some_str is str.
some_str = stash[some_str_key]
# The static type of some_bool is bool.
some_bool = stash[some_bool_key]
.. versionadded:: 7.0
��_storagec � � i | _ y )Nr ��selfs r �__init__zStash.__init__H s � �57��
r c �"