1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
U
Z±dã@s8ddlmZddlmZedd„ƒZdd„Zdd    „Zd
S) é)Úcontextmanageré)Ú_coreccsjd}t ¡}|j}|j}z*dV|r@|j|ks8|j|kr@tdƒ‚W5|sd|j|ks\|j|krdtdƒ‚XdS)NTz$assert_no_checkpoints block yielded!z'assert_checkpoints block did not yield!)rZ current_taskZ_cancel_pointsZ_schedule_pointsÚAssertionError)ÚexpectedÚ__tracebackhide__ZtaskZ orig_cancelZ orig_schedule©rúPd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\trio/testing/_checkpoints.pyÚ_assert_yields_or_nots$ÿÿ ÿÿr
cCs d}tdƒS)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
©rrrr    Úassert_checkpointssr cCs d}tdƒS)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 rrr    Úassert_no_checkpoints-srN)Ú
contextlibrÚrr
r rrrrr    Ú<module>s