o
    %if                     @  sp  d Z ddlmZ ddlZddlmZ ddlmZ ddlmZ ddlZddl	Z	er:ddl
mZ ddlmZ dd	lmZ e	 dCddZe	 dDddZe	jedddEddZe	jedddEddZe	jd d!dFd#d$Ze	 dGd'd(Ze	 dGd)d*Ze	 dHd-d.Ze	 dId1d2Ze	jd d!dJd6d7Ze	jd d!dKd9d:Ze	jd d!dLdAdBZdS )Ma  
xdist hooks.

Additionally, pytest-xdist will also decorate a few other hooks
with the worker instance that executed the hook originally:

``pytest_runtest_logreport``: ``rep`` parameter has a ``node`` attribute.

You can use this hooks just as you would use normal pytest hooks, but some care
must be taken in plugins in case ``xdist`` is not installed. Please see:

    http://pytest.org/en/latest/writing_plugins.html#optionally-using-hooks-from-3rd-party-plugins
    )annotationsN)Any)Sequence)TYPE_CHECKING)Producer)
Scheduling)WorkerControllerconfigpytest.ConfigspecsSequence[execnet.XSpec]returnNonec                 C     dS )z(Called before any remote node is set up.N )r	   r   r   r   G/var/www/html/corbot_env/lib/python3.10/site-packages/xdist/newhooks.pypytest_xdist_setupnodes        r   gatewayexecnet.Gatewayc                 C  r   )z#Called on new raw gateway creation.Nr   )r   r   r   r   pytest_xdist_newgateway'   r   r   zCrsync feature is deprecated and will be removed in pytest-xdist 4.0)warn_on_implsourcestr | os.PathLike[str]gatewaysSequence[execnet.Gateway]c                 C  r   )zBCalled before rsyncing a directory to remote gateways takes place.Nr   r   r   r   r   r   pytest_xdist_rsyncstart,   r   r   c                 C  r   )zACalled after rsyncing a directory to remote gateways takes place.Nr   r   r   r   r   pytest_xdist_rsyncfinish8   r   r   T)firstresultr   c                   C  r   )z!Called when creating remote node.Nr   r   r   r   r   pytest_xdist_getremotemoduleD   r   r    noder   c                 C  r   )z7Configure node information before it gets instantiated.Nr   r!   r   r   r   pytest_configure_nodeI   r   r#   c                 C  r   )zTest Node is ready to operate.Nr   r"   r   r   r   pytest_testnodereadyN   r   r$   errorobject | Nonec                 C  r   )zTest Node is down.Nr   )r!   r%   r   r   r   pytest_testnodedownS   r   r'   idsSequence[str]c                 C  r   )zECalled by the controller node when a worker node finishes collecting.Nr   )r!   r(   r   r   r   %pytest_xdist_node_collection_finishedX   r   r*   logr   Scheduling | Nonec                 C  r   )z'Return a node scheduler implementation.Nr   )r	   r+   r   r   r   pytest_xdist_make_scheduler_   r   r-   intc                 C  s   t  )z
    Return the number of workers to spawn when ``--numprocesses=auto`` is given in the
    command-line.

    .. versionadded:: 2.1
    )NotImplementedError)r	   r   r   r   pytest_xdist_auto_num_workersf   s   r0   	crashitemstrreportpytest.TestReportschedr   c                 C  r   )a  
    Handle a crashitem, modifying the report if necessary.

    The scheduler is provided as a parameter to reschedule the test if desired with
    `sched.mark_test_pending`.

    def pytest_handlecrashitem(crashitem, report, sched):
        if should_rerun(crashitem):
            sched.mark_test_pending(crashitem)
            report.outcome = "rerun"

    .. versionadded:: 2.2.1
    Nr   )r1   r3   r5   r   r   r   pytest_handlecrashitemq   r   r6   )r	   r
   r   r   r   r   )r   r   r   r   )r   r   r   r   r   r   )r   r   )r!   r   r   r   )r!   r   r%   r&   r   r   )r!   r   r(   r)   r   r   )r	   r
   r+   r   r   r,   )r	   r
   r   r.   )r1   r2   r3   r4   r5   r   r   r   )__doc__
__future__r   ostypingr   r   r   execnetpytestxdist.remoter   xdist.scheduler.protocolr   xdist.workermanager   hookspecr   r   DeprecationWarningr   r   r    r#   r$   r'   r*   r-   r0   r6   r   r   r   r   <module>   sX    




