o
    oi
                     @   s`   d dl mZmZmZ d dlmZ d dlmZ ddlm	Z	 ddl
mZ dd ZG d	d
 d
e	ZdS )    )absolute_importprint_functiondivisionwraps)_get_hub   )QuietHub)get_switch_expectedc                    s   t   fdd}|S )Nc                    s   t t dd }t | dd| _|d ur$t | dd }| jdkr$|r$t|| _ | g|R i |}|d urj| jd urjt j| }| jdu rS|dksIJ |sQtd| |S | jdu rb|r`td	| |S td
| jf |S )Nswitch_countswitch_expectedTfullnamedefaultr   z%s did not switchFz%s switched but not expected toz%Invalid value for switch_expected: %r)getattrr   r   r
   r   AssertionError)selfargskwargsinitial_switch_countr   resultr   method W/var/www/html/pca-backend/venv/lib/python3.10/site-packages/gevent/testing/switching.pywrapper   s(   


z(wrap_switch_count_check.<locals>.wrapperr   )r   r   r   r   r   wrap_switch_count_check   s   r   c                   @   s   e Zd ZdZdd ZdS )CountingHubr   c                 G   s    |  j d7  _ tj| g|R  S )Nr   )r   r	   switch)r   r   r   r   r   r   =   s   zCountingHub.switchN)__name__
__module____qualname__r   r   r   r   r   r   r   9   s    r   N)
__future__r   r   r   	functoolsr   
gevent.hubr   hubr	   patched_tests_setupr
   r   r   r   r   r   r   <module>   s   