Ë
    •Kêj5  ã                  óh   — d Z ddlmZ ddlZ ej                  ddd¬«       G d„ d«      «       Zd	d„Zy)
aù  Structured representation of a pytest "nodeid".

A nodeid is represented as a ``::``-separated string, identifying a node in the collection
tree, e.g. ``path/to/test_file.py::TestClass::test_method[param]``.

The :class:`NodeId` class represents that information in a proper dataclass with the relevant
parts readily available, avoiding reparsing that information when needed and also making for
a better type than `str`.

The traditional ``::``-joined string form remains available via ``str(node_id)``.
é    )ÚannotationsNT)ÚfrozenÚslotsÚkw_onlyc                  óª   — e Zd ZU dZded<   dZded<   dZded	<    ej                  dd
d
d
¬«      Z	ded<   e
dd„«       Zdd„Zedd„«       Zdd„Zdd„Zy)ÚNodeIda&  Structured identifier of a node in the collection tree.

    :param path:
        ``/``-normalized, rootpath-relative filesystem path.  Empty string
        for the session root.
    :param names:
        Ordered ``::``-segment names after the path.
    :param params:
        Raw contents inside the outermost ``[...]`` bracket, kept as one
        opaque string -- traditional string-node ids are often recovered from the outside (for example
        files), so we cannot recover the actual params and values used to build the parametrization.
    ÚstrÚpath© ztuple[str, ...]ÚnamesNú
str | NoneÚparamsF)ÚdefaultÚinitÚreprÚcompareÚ
_str_cachec                ó  — |j                  d«      \  }}}|s
 | |¬«      }nO|j                  d«      \  }}}t        |j                  d«      «      }	|r|j                  d«      nd}
 | ||	|
¬«      }t        j                  |d|«       |S )z;Parse a nodeid string into its path, names, and raw params.ú::)r
   ú[ú]N©r
   r   r   r   )Ú	partitionÚtupleÚsplitÚremovesuffixÚobjectÚ__setattr__)ÚclsÚnodeidr
   ÚsepÚtailÚselfÚ	name_partÚbracketÚ
param_partr   r   s              úS/home/oem/CyberBrain26-unified/.venv/lib/python3.12/site-packages/_pytest/nodeid.pyÚparsezNodeId.parse(   s�   € ð !×*Ñ*¨4Ó0‰ˆˆc�4Ùñ ˜D”>‰Dð .2¯^©^¸CÓ-@Ñ*ˆI�w 
Ü˜)Ÿ/™/¨$Ó/Ó0ˆEÙ5<�Z×,Ñ,¨SÔ1À$ˆFÙ˜D¨°fÔ=ˆDô 	×Ñ˜4 ¨vÔ6Øˆó    c                óô   — | j                   �| j                   S dj                  | j                  g| j                  ¢­«      }| j                  �|d| j                  › d�z  }t
        j                  | d|«       |S )Nr   r   r   r   )r   Újoinr
   r   r   r   r   ©r#   Úss     r'   Ú__str__zNodeId.__str__;   sl   € Ø�?‰?Ð&Ø—?‘?Ð"Ø�I‰I�t—y‘yÐ. 4§:¡:Ñ.Ó/ˆØ�;‰;Ð"Ø�1�T—[‘[�M Ð#Ñ#ˆAÜ×Ñ˜4 ¨qÔ1Øˆr)   c                ó”   — | j                   sydj                  | j                   «      }| j                  �|d| j                  › d�z  }|S )z‰Everything after the first ``"::"`` as a single string, or
        ``None`` when there is no ``"::"`` (i.e. ``names`` is empty).
        Nr   r   r   )r   r+   r   r,   s     r'   ÚrestzNodeId.restD   sF   € ð
 �zŠzØØ�I‰I�d—j‘jÓ!ˆØ�;‰;Ð"Ø�1�T—[‘[�M Ð#Ñ#ˆAØˆr)   c                ó„   — | j                   �t        d| ›d�«      ‚t        | j                  g | j                  ¢|‘­¬«      S )zñReturn a new :class:`NodeId` for a child collector node.

        :raises ValueError: if called on a node that already has params
            (i.e., a leaf item) -- only collector ids (``params=None``) can
            have children.
        z+cannot call .child() on a parameterised id z4; only collector ids (params=None) can have children)r
   r   ©r   Ú
ValueErrorr   r
   r   )r#   Únames     r'   ÚchildzNodeId.childP   sQ   € ð �;‰;Ð"ÜØ=¸d¸Xð FEð Eóð ô ˜4Ÿ9™9Ð,?¨d¯j©jÐ,?¸$Ñ,?Ô@Ð@r)   c                ó|   — | j                   �t        d| ›d�«      ‚t        | j                  | j                  |¬«      S )z·Return a new :class:`NodeId` with ``params`` set.

        :raises ValueError: if ``self`` is already parameterised (i.e. an
            item id with ``params is not None``).
        z1cannot call .with_params() on a parameterised id z7; only collector ids (params=None) can be parameterisedr   r2   )r#   r   s     r'   Úwith_paramszNodeId.with_params^   sH   € ð �;‰;Ð"ÜØCÀDÀ8ð LHð Hóð ô ˜4Ÿ9™9¨D¯J©J¸vÔFÐFr)   )r    r	   Úreturnr   )r8   r	   )r8   r   )r4   r	   r8   r   )r   r   r8   r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú__annotations__r   r   ÚdataclassesÚfieldr   Úclassmethodr(   r.   Úpropertyr0   r5   r7   r   r)   r'   r   r      s}   … ñð ƒIØ€Eˆ?ÓØ€FˆJÓØ.˜[×.Ñ.Ø˜5 u°eô€J�
ó ð òó ðó$ð ò	ó ð	óAôGr)   r   c                óP   — t        | t        «      r| S t        j                  | «      S )zjReturn ``nodeid`` unchanged if already a :class:`NodeId`; otherwise
    parse it via :meth:`NodeId.parse`.)Ú
isinstancer   r(   )r    s    r'   Úcoerce_node_idrD   l   s"   € ô �&œ&Ô!ØˆÜ�<‰<˜ÓÐr)   )r    zstr | NodeIdr8   r   )r<   Ú
__future__r   r>   Ú	dataclassr   rD   r   r)   r'   ú<module>rG      sH   ðñ
õ #ã ð €×Ñ˜d¨$¸Ô=÷VGð VGó >ðVGôr r)   