§
    “¸Îiá  ã                  óh   — d dl mZ d dlZd dlmc mZ d dlZd dl	m
Z
 ddlmZ  G d„ de¦  «        ZdS )é    )ÚannotationsN)ÚProduceré   )ÚLoadScopeSchedulingc                  ó.   ‡ — e Zd ZdZddˆ fd	„Zdd„Zˆ xZS )ÚLoadGroupSchedulingzóImplement load scheduling across nodes, but grouping test by xdist_group mark.

    This class behaves very much like LoadScopeScheduling, but it groups tests by xdist_group mark
    instead of the module or class to which they belong to.
    NÚconfigúpytest.ConfigÚlogúProducer | NoneÚreturnÚNonec                ó”   •— t          ¦   «                              ||¦  «         |€t          d¦  «        | _        d S |j        | _        d S )NÚloadgroupsched)ÚsuperÚ__init__r   r   r   )Úselfr	   r   Ú	__class__s      €ú`/home/ubuntu/.hermes/hermes-agent/venv/lib/python3.11/site-packages/xdist/scheduler/loadgroup.pyr   zLoadGroupScheduling.__init__   sD   ø€ Ý‰Œ×Ò˜ Ñ%Ô%Ð%Øˆ;ÝÐ 0Ñ1Ô1ˆDŒHˆHˆHàÔ)ˆDŒHˆHˆHó    ÚnodeidÚstrc                ó”   — |                      d¦  «        |                      d¦  «        k    r|                     d¦  «        d         S |S )a  Determine the scope (grouping) of a nodeid.

        There are usually 3 cases for a nodeid::

            example/loadsuite/test/test_beta.py::test_beta0
            example/loadsuite/test/test_delta.py::Delta1::test_delta0
            example/loadsuite/epsilon/__init__.py::epsilon.epsilon

        #. Function in a test module.
        #. Method of a class in a test module.
        #. Doctest in a function in a package.

        With loadgroup, two cases are added::

            example/loadsuite/test/test_beta.py::test_beta0
            example/loadsuite/test/test_delta.py::Delta1::test_delta0
            example/loadsuite/epsilon/__init__.py::epsilon.epsilon
            example/loadsuite/test/test_gamma.py::test_beta0@gname
            example/loadsuite/test/test_delta.py::Gamma1::test_gamma0@gname

        This function will group tests with the scope determined by splitting the first ``@``
        from the right. That is, test will be grouped in a single work unit when they have
        same group name. In the above example, scopes will be::

            example/loadsuite/test/test_beta.py::test_beta0
            example/loadsuite/test/test_delta.py::Delta1::test_delta0
            example/loadsuite/epsilon/__init__.py::epsilon.epsilon
            gname
            gname
        ú@Ú]éÿÿÿÿ)ÚrfindÚsplit)r   r   s     r   Ú_split_scopez LoadGroupScheduling._split_scope   sC   € ð> <Š<˜ÑÔ˜vŸ|š|¨CÑ0Ô0Ò0Ð0à—<’< Ñ$Ô$ RÔ(Ð(àˆMr   )N)r	   r
   r   r   r   r   )r   r   r   r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   Ú__classcell__)r   s   @r   r   r   
   s`   ø€ € € € € ðð ð*ð *ð *ð *ð *ð *ð *ð#ð #ð #ð #ð #ð #ð #ð #r   r   )Ú
__future__r   ÚbuiltinsÚ@py_builtinsÚ_pytest.assertion.rewriteÚ	assertionÚrewriteÚ
@pytest_arÚpytestÚxdist.remoter   Ú	loadscoper   r   © r   r   ú<module>r0      s“   ðØ "Ð "Ð "Ð "Ð "Ð "à  € € € € € € € € € € € € €€€€à !Ð !Ð !Ð !Ð !Ð !à *Ð *Ð *Ð *Ð *Ð *ð1ð 1ð 1ð 1ð 1Ð-ñ 1ô 1ð 1ð 1ð 1r   