| Server IP : 127.0.0.1 / Your IP : 216.73.216.109 Web Server : Apache/2.4.54 (Win64) OpenSSL/1.1.1q PHP/8.1.10 System : Windows NT DESKTOP-E5T4RUN 10.0 build 19045 (Windows 10) AMD64 User : SERVERWEB ( 0) PHP Version : 8.1.10 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/cygwin64/lib/python3.9/site-packages/_pytest/__pycache__/ |
Upload File : |
a
05d� � @ s� d dl mZ d dl mZ d dl mZ d dl mZ d dl mZ d dl mZ ddgZed �Zed
�Z G dd� dee �Z
G dd� d�Zd
S )� )�Any)�cast)�Dict)�Generic)�TypeVar)�Union�Stash�StashKey�T�Dc @ s e Zd ZdZdZdS )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.
� N)�__name__�
__module__�__qualname__�__doc__� __slots__r r r �1/usr/lib/python3.9/site-packages/_pytest/stash.pyr s c @ s� e Zd ZdZdZdd�dd�Zee edd�dd �Zee ed
�dd�Z ee e
eee
f d
�dd�Zee eed
�dd�Z
ee dd
�dd�Zee ed
�dd�Zed�dd�ZdS )r a/ ``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]
��_storageN)�returnc C s
i | _ d S )Nr ��selfr r r �__init__D s zStash.__init__)�key�valuer c C s || j |<