PATH:
opt
/
hc_python
/
lib
/
python3.12
/
site-packages
/
greenlet
/
tests
# -*- coding: utf-8 -*- """ A test helper for seeing what happens when slp_switch() fails. """ # pragma: no cover import greenlet print('fail_slp_switch is running', flush=True) runs = [] def func(): runs.append(1) greenlet.getcurrent().parent.switch() runs.append(2) greenlet.getcurrent().parent.switch() runs.append(3) g = greenlet._greenlet.UnswitchableGreenlet(func) g.switch() assert runs == [1] g.switch() assert runs == [1, 2] g.force_slp_switch_error = True # This should crash. g.switch()
[-] fail_clearing_run_switches.py
[edit]
[+]
__pycache__
[-] fail_switch_two_greenlets.py
[edit]
[-] fail_slp_switch.py
[edit]
[-] _test_extension.cpython-312-x86_64-linux-gnu.so
[edit]
[-] test_generator.py
[edit]
[-] test_extension_interface.py
[edit]
[-] test_greenlet.py
[edit]
[-] test_tracing.py
[edit]
[-] _test_extension_cpp.cpp
[edit]
[-] __init__.py
[edit]
[-] test_throw.py
[edit]
[-] test_version.py
[edit]
[-] test_greenlet_trash.py
[edit]
[-] test_gc.py
[edit]
[+]
..
[-] _test_extension.c
[edit]
[-] test_stack_saved.py
[edit]
[-] test_cpp.py
[edit]
[-] test_weakref.py
[edit]
[-] fail_switch_three_greenlets2.py
[edit]
[-] fail_initialstub_already_started.py
[edit]
[-] leakcheck.py
[edit]
[-] fail_cpp_exception.py
[edit]
[-] test_contextvars.py
[edit]
[-] _test_extension_cpp.cpython-312-x86_64-linux-gnu.so
[edit]
[-] test_leaks.py
[edit]
[-] test_generator_nested.py
[edit]
[-] fail_switch_three_greenlets.py
[edit]