
    vKgW                    z    S SK Jr  S SKJrJr  S SKJr  SSKJr  \(       a  S SK	J
r
  \SS j5       rSS jrSS	 jrg
)    )annotations)AbstractContextManagercontextmanager)TYPE_CHECKING   )_core)	Generatorc              #    #    Sn[         R                  " 5       nUR                  nUR                  n Sv   U (       a+  UR                  U:X  d  UR                  U:X  a  [	        S5      eU (       d,  UR                  U:w  d  UR                  U:w  a  [	        S5      egg! U (       d,  UR                  U:w  d  UR                  U:w  a  [	        S5      ef f = f7f)z5Check if checkpoints are executed in a block of code.TNz'assert_checkpoints block did not yield!z$assert_no_checkpoints block yielded!)r   current_task_cancel_points_schedule_pointsAssertionError)expected__tracebackhide__taskorig_cancelorig_schedules        Y/var/www/highfloat_scraper/venv/lib/python3.13/site-packages/trio/testing/_checkpoints.py_assert_yields_or_notr      s      D%%K))M
I;.$2G2G=2X !JKK;.$2G2G=2X !GHH 3Y x;.$2G2G=2X !GHH 3Y s   0C6B )4C5CCc                     Sn [        S5      $ )a  Use as a context manager to check that the code inside the ``with``
block either exits with an exception or executes at least one
:ref:`checkpoint <checkpoints>`.

Raises:
  AssertionError: if no checkpoint was executed.

Example:
  Check that :func:`trio.sleep` is a checkpoint, even if it doesn't
  block::

     with trio.testing.assert_checkpoints():
         await trio.sleep(0)

Tr   r   s    r   assert_checkpointsr       s       &&    c                     Sn [        S5      $ )a  Use as a context manager to check that the code inside the ``with``
block does not execute any :ref:`checkpoints <checkpoints>`.

Raises:
  AssertionError: if a checkpoint was executed.

Example:
  Synchronous code never contains any checkpoints, but we can double-check
  that::

     send_channel, receive_channel = trio.open_memory_channel(10)
     with trio.testing.assert_no_checkpoints():
         send_channel.send_nowait(None)

TFr   r   s    r   assert_no_checkpointsr   4   s       ''r   N)r   boolreturnzGenerator[None, None, None])r   zAbstractContextManager[None])
__future__r   
contextlibr   r   typingr    r   collections.abcr	   r   r   r    r   r   <module>r%      s7    " =   ) I I&'((r   