| 1 |
# cython: language_level=3 |
| 2 |
import trio |
| 3 |
|
| 4 |
# the output of the prints are not currently checked, we only check |
| 5 |
# if the program can be compiled and doesn't crash when run. |
| 6 |
|
| 7 |
# The content of the program can easily be extended if there's other behaviour |
| 8 |
# that might be likely to be problematic for cython. |
| 9 |
async def foo() -> None: |
| 10 |
print('.') |
| 11 |
|
| 12 |
async def trio_main() -> None: |
| 13 |
print('hello...') |
| 14 |
await trio.sleep(1) |
| 15 |
print(' world !') |
| 16 |
|
| 17 |
async with trio.open_nursery() as nursery: |
| 18 |
nursery.start_soon(foo) |
| 19 |
nursery.start_soon(foo) |
| 20 |
nursery.start_soon(foo) |
| 21 |
|
| 22 |
def invoke_main_entry_point(): |
| 23 |
trio.run(trio_main) |