ó
    ¸®iW  ã                  ó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        ÚFC:\des-py\RoboSAPF\venv\Lib\site-packages\trio/testing/_checkpoints.pyÚ_assert_yields_or_notr      sÎ   é € ð ÐÜ×ÒÓ€DØ×%Ñ%€KØ×)Ñ)€Mð
IÛÞØ×Ñ ;Ó.°$×2GÑ2GÈ=Ó2Xä Ð!JÓKÐKæØ×Ñ ;Ó.°$×2GÑ2GÈ=Ó2Xä Ð!GÓHÐHð 3Yð øŽxØ×Ñ ;Ó.°$×2GÑ2GÈ=Ó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   