a
    4ñ»jµ  ã                   @  sÆ  d Z ddlmZ ddlmZ ddlZddlmZ ddlmZ ddl	Z	ddl
Z
ertddlmZ ddlmZ dd	lmZ e
 ¡ d
dddœdd„ƒZe
 ¡ dddœdd„ƒZe
jedƒd�ddddœdd„ƒZe
jedƒd�ddddœdd„ƒZe
jdd�dd œd!d"„ƒZe
 ¡ d#dd$œd%d&„ƒZe
 ¡ d#dd$œd'd(„ƒZe
 ¡ d#d)dd*œd+d,„ƒZe
 ¡ d#d-dd.œd/d0„ƒZe
jdd�d
d1d2d3œd4d5„ƒZe
jdd�d
d6d7œd8d9„ƒZe
jdd�d:d;d<dd=œd>d?„ƒZdS )@aÔ  
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
é    )Úannotations)ÚSequenceN)ÚAny)ÚTYPE_CHECKING)ÚProducer)Ú
Scheduling)ÚWorkerControllerzpytest.ConfigzSequence[execnet.XSpec]ÚNone)ÚconfigÚspecsÚreturnc                 C  s   dS )z(Called before any remote node is set up.N© )r
   r   r   r   ú4E:\soccer\ml_env\Lib\site-packages\xdist/newhooks.pyÚpytest_xdist_setupnodes    s    r   zexecnet.Gateway)Úgatewayr   c                 C  s   dS )z#Called on new raw gateway creation.Nr   )r   r   r   r   Úpytest_xdist_newgateway'   s    r   zCrsync feature is deprecated and will be removed in pytest-xdist 4.0)Zwarn_on_implzstr | os.PathLike[str]zSequence[execnet.Gateway])ÚsourceÚgatewaysr   c                 C  s   dS )zBCalled before rsyncing a directory to remote gateways takes place.Nr   ©r   r   r   r   r   Úpytest_xdist_rsyncstart,   s    	r   c                 C  s   dS )zACalled after rsyncing a directory to remote gateways takes place.Nr   r   r   r   r   Úpytest_xdist_rsyncfinish8   s    	r   T)Zfirstresultr   )r   c                   C  s   dS )z!Called when creating remote node.Nr   r   r   r   r   Úpytest_xdist_getremotemoduleD   s    r   r   )Únoder   c                 C  s   dS )z7Configure node information before it gets instantiated.Nr   ©r   r   r   r   Úpytest_configure_nodeI   s    r   c                 C  s   dS )zTest Node is ready to operate.Nr   r   r   r   r   Úpytest_testnodereadyN   s    r   zobject | None)r   Úerrorr   c                 C  s   dS )zTest Node is down.Nr   )r   r   r   r   r   Úpytest_testnodedownS   s    r   zSequence[str])r   Úidsr   c                 C  s   dS )zECalled by the controller node when a worker node finishes collecting.Nr   )r   r   r   r   r   Ú%pytest_xdist_node_collection_finishedX   s    r   r   zScheduling | None)r
   Úlogr   c                 C  s   dS )z'Return a node scheduler implementation.Nr   )r
   r    r   r   r   Úpytest_xdist_make_scheduler_   s    r!   Úint)r
   r   c                 C  s
   t ƒ ‚dS )z‰
    Return the number of workers to spawn when ``--numprocesses=auto`` is given in the
    command-line.

    .. versionadded:: 2.1
    N)ÚNotImplementedError)r
   r   r   r   Úpytest_xdist_auto_num_workersf   s    r$   Ústrzpytest.TestReportr   )Ú	crashitemÚreportÚschedr   c                 C  s   dS )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   )r&   r'   r(   r   r   r   Úpytest_handlecrashitemq   s    r)   )Ú__doc__Ú
__future__r   Úcollections.abcr   ÚosÚtypingr   r   ZexecnetZpytestZxdist.remoter   Zxdist.scheduler.protocolr   Zxdist.workermanager   Zhookspecr   r   ÚDeprecationWarningr   r   r   r   r   r   r   r!   r$   r)   r   r   r   r   Ú<module>   sV   ÿÿÿÿ




