
    ih
                     d    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y
)    )absolute_importprint_functiondivisionwraps)_get_hub   )QuietHub)get_switch_expectedc                 .     t                fd       }|S )Nc                    t        t               dd       }t        | dd      | _        |.t        | dd       }| j                  dk(  r|rt        |      | _         | g|i |}|| j                  vt               j                  |z
  }| j                  du r|dk\  sJ |st        dz        |S | j                  du r|rt        d	z        |S 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          V/var/www/html/dev/engine/venv/lib/python3.12/site-packages/gevent/testing/switching.pywrapperz(wrap_switch_count_check.<locals>.wrapper   s   &xz>4H&t->E+tZ6H##y0X':8'D$.t.v.+0D0D0P#:225IIL##t+#q(((#()<x)GHH  %%.()JX)UVV  %PTPdPd%ghh    r   )r   r   s   ` r   wrap_switch_count_checkr      s     
6] ( Nr   c                       e Zd ZdZd Zy)CountingHubr   c                 X    | xj                   dz  c_         t        j                  | g| 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6,( ,r   