
    i
                     l    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 Z G d d	e	          Zd
S )    )absolute_importprint_functiondivisionwraps)_get_hub   )QuietHub)get_switch_expectedc                 <     t                      fd            }|S )Nc                    t          t                      dd           }t          | dd          | _        |2t          | dd           }| j        dk    r|rt          |          | _         | g|R i |}|x| j        qt                      j        |z
  }| j        du r|dk    sJ |st          d|z            n5| j        du r|rt          d	|z            nt          d
| j                  |S )Nswitch_countswitch_expectedTfullnamedefaultr   z%s did not switchFz%s switched but not expected toz#Invalid value for switch_expected: )getattrr   r   r   r   AssertionError)selfargskwargsinitial_switch_countr   resultr   methods          C/usr/local/lib/python3.11/dist-packages/gevent/testing/switching.pywrapperz(wrap_switch_count_check.<locals>.wrapper   s;   &xzz>4HH&t->EE+tZ66H#y00X0':8'D'D$.t...v..+0D0P#::25IIL#t++#q((((# I()<x)GHHHI%.. W()JX)UVVVW %nPTPdPd%ghhh    r   )r   r   s   ` r   wrap_switch_count_checkr      s3    
6]]    ]( Nr   c                       e Zd ZdZd ZdS )CountingHubr   c                 F    | xj         dz  c_         t          j        | g|R  S )Nr	   )r   r
   switch)r   r   s     r   r!   zCountingHub.switch=   s.    Qt+d++++r   N)__name__
__module____qualname__r   r!    r   r   r   r   9   s(        L, , , , ,r   r   N)
__future__r   r   r   	functoolsr   
gevent.hubr   hubr
   patched_tests_setupr   r   r   r%   r   r   <module>r+      s   ( A @ @ @ @ @ @ @ @ @                   4 4 4 4 4 4  6, , , , ,( , , , , ,r   